Wednesday, March 7, 2007

Quick Ruby Quiz

I was talking to the Dallas Ruby group a couple of days ago, and showed them the following code:


class Fred
class << self
def self.say_hello
puts "Hi!"
end
end
end

Someone asked whether it was possible to call the say_hello method. It is. How many ways can you find?

No comments:

Post a Comment