Skip to content

Instantly share code, notes, and snippets.

@sdanko11
Last active December 30, 2015 03:59
Show Gist options
  • Select an option

  • Save sdanko11/7772597 to your computer and use it in GitHub Desktop.

Select an option

Save sdanko11/7772597 to your computer and use it in GitHub Desktop.
Animals Classes
class Animal
attr_reader :animal_name
def initialize(name)
@animal_name = (name)
end
def eat(what_they_eat)
puts "just ate #{what_they_eat}"
end
end
class Dog < Animal
attr_reader :bark
def bark
"ruff ruff"
end
end
class Duck < Animal
attr_reader :quak
def quack
puts 'quack quack'
end
end
class Cat < Animal
attr_reader :meow
def meow
puts 'meow'
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment