Created
November 30, 2015 20:22
-
-
Save rapala61/b4ebd78c91e1c23e6712 to your computer and use it in GitHub Desktop.
Kitten Class
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 Kitten | |
@@lives = 9 | |
# serves the purpose of setting up the object | |
def initialize( name, color, owner ) | |
@name = name | |
@color = color | |
@owner = owner | |
end | |
# getter method | |
def name | |
@name | |
end | |
# setter method | |
def name=(new_name) | |
@name = new_name | |
end | |
def lives | |
@@lives | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment