Created
November 14, 2017 16:08
-
-
Save btaitelb/f8421f79443c5df2badc489acc1c97ca to your computer and use it in GitHub Desktop.
This file contains hidden or 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
require './animal' | |
class Panda < Animal | |
def initialize | |
super(2) | |
puts "Panda#initialize" | |
end | |
def speak | |
super | |
puts "nom, nom, nom!" | |
end | |
def name | |
"#{@name} nom nom" | |
end | |
attr_writer :bamboo_limit | |
# def bamboo_limit=(limit) | |
# @bamboo_limit = limit | |
# end | |
def healthy? | |
name = @name | |
if self.name == 'Po nom nom' | |
(3..6).include?(@bamboo_limit) | |
else | |
(2..4).include?(@bamboo_limit) | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
we miss the horse