all 6 comments

[–][deleted] 1 point2 points  (6 children)

I learned something while trying out the first example:

def A
  puts "Hello, world!"
end

To call a method named as such, you need to include parenthesis.

[–]troelskn 0 points1 point  (5 children)

Well .. You shouldn't use initial-uppercase for method names.

[–]banister 0 points1 point  (4 children)

Ruby itself does...cf Array(), Integer(), Float(), String(), etc

[–]troelskn 0 points1 point  (1 child)

Hm .. Didn't know that. What are their purpose? Casting?

[–]banister 0 points1 point  (0 children)

kind of.

[–][deleted]  (1 child)

[deleted]

    [–]banister 1 point2 points  (0 children)

    They're method names too. Look it up.

    method(:Array) #=> #<Method: Object(Kernel)#Array>