Skip to content

Instantly share code, notes, and snippets.

@mufasa71
Created August 24, 2013 10:57
Show Gist options
  • Save mufasa71/6327470 to your computer and use it in GitHub Desktop.
Save mufasa71/6327470 to your computer and use it in GitHub Desktop.
class Roulette
def method_missing(name, *args)
person = name.to_s.capitalize
super unless %w[Bob Frank Bill].include? person
number = 0
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