Created
October 25, 2012 02:42
-
-
Save ruevaughn/3950150 to your computer and use it in GitHub Desktop.
Thanking Nick in Ruby
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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