Skip to content

Instantly share code, notes, and snippets.

@deepakkumarnd
Created November 14, 2012 17:14
Show Gist options
  • Select an option

  • Save deepakkumarnd/4073407 to your computer and use it in GitHub Desktop.

Select an option

Save deepakkumarnd/4073407 to your computer and use it in GitHub Desktop.
One small ruby puzzle
class Roulette
def method_missing(name, *args)
person = name.to_s.capitalize
3.times do
number = rand(10) + 1
puts "#{number}..."
end
"#{person} got a #{number}"
end
end
number_of = Roulette.new
puts number_of.bob
puts number_of.frank
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment