Skip to content

Instantly share code, notes, and snippets.

@lucassmagal
Created November 14, 2012 17:28
Show Gist options
  • Save lucassmagal/4073499 to your computer and use it in GitHub Desktop.
Save lucassmagal/4073499 to your computer and use it in GitHub Desktop.
dog.rb
class Dog
def initialize(name)
@myname = name
end
def set_name( aName )
@myname = aName
end
def get_name
return @myname
end
def talk
return 'woof!'
end
end
mydog = Dog.new('Fido')
puts(mydog.get_name)
puts(mydog.talk)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment