Skip to content

Instantly share code, notes, and snippets.

@ruevaughn
Created October 25, 2012 02:42
Show Gist options
  • Save ruevaughn/3950150 to your computer and use it in GitHub Desktop.
Save ruevaughn/3950150 to your computer and use it in GitHub Desktop.
Thanking Nick in Ruby
class ThankYou
def initialize(name, custom_message = nil)
@name = name
custom_message.nil? ? @custom_message = "Thank you" : @custom_message = custom_message
end
def greet
puts "#{@custom_message}, #{@name}"
end
end
newgreeting = ThankYou.new("Nick", "Thanks")
newgreeting.greet
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment