Skip to content

Instantly share code, notes, and snippets.

@Phoenix23A
Created February 21, 2017 17:46
Show Gist options
  • Save Phoenix23A/4cdabed738218b587159312741ba758e to your computer and use it in GitHub Desktop.
Save Phoenix23A/4cdabed738218b587159312741ba758e to your computer and use it in GitHub Desktop.
class Cat
attr_reader :color, :breed
attr_accessor :name
def initialize(color, breed)
@color = color
@breed = breed
@hungry = true
end
def feed(food)
puts "Mmmm, " + food + "!"
@hungry = false
end
def hungry?
if @hungry
puts "I\'m hungry!"
else
puts "I\'m full!"
end
@hungry
end
def speak
puts "Meow!"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment