Skip to content

Instantly share code, notes, and snippets.

@stefanpenner
Forked from anonymous/gist:159295
Created July 31, 2009 16:17
Show Gist options
  • Save stefanpenner/159296 to your computer and use it in GitHub Desktop.
Save stefanpenner/159296 to your computer and use it in GitHub Desktop.
class Greeter
def initialize(name = "World")
@name = name
end
def say_hi
puts "Hi #{@name}!"
end
def say_bye
puts "Bye #{@name}!"
end
end
# new calls the initializer def
Greater.new.say_hi
Greate.new("Jimmy").say_hi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment