Skip to content

Instantly share code, notes, and snippets.

@JRJurman
Created September 1, 2013 05:07
Show Gist options
  • Select an option

  • Save JRJurman/6402463 to your computer and use it in GitHub Desktop.

Select an option

Save JRJurman/6402463 to your computer and use it in GitHub Desktop.
Greeter, the CORRECT WAY!
print "Enter Name: "
name = gets.chomp
Greeter = Class.new do
puts "Hold up a second #{name}, Greeter is starting up..."
define_method :greet do
puts "#{['hey', 'hello', 'howdy', 'yo'].shuffle[0]} #{name}"
end
end
g = Greeter.new
g.greet
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment