Last active
December 21, 2015 15:11
-
-
Save toddseller/102d50c73a1d243cc78f to your computer and use it in GitHub Desktop.
Defining the hungry method
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 Dog | |
def initialize(name, breed) | |
@name = name | |
@breed = breed | |
@hungry = false | |
end | |
def feed | |
puts "You just fed #{@name}, the #{@breed}." | |
end | |
end | |
puppy = Dog.new('Atticus', 'German Shepherd') | |
puppy.feed | |
>> "You just fed Atticus, the German Shepherd." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment