Skip to content

Instantly share code, notes, and snippets.

@StephenFiser
Created June 2, 2014 14:39
Show Gist options
  • Select an option

  • Save StephenFiser/1d7472613870fb180d9d to your computer and use it in GitHub Desktop.

Select an option

Save StephenFiser/1d7472613870fb180d9d to your computer and use it in GitHub Desktop.
class Animal
attr_accessor :name
attr_reader :size, :color
def initialize(name, size, color)
@name = name
@size = size
@color = color
end
def walk
"walking..."
end
def eat
"eating..."
end
def sleep
"sleeping..."
end
end
class Dog < Animal
def bark
"Ruff!"
end
end
class Cat < Animal
def meow
"Meow..."
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment