Skip to content

Instantly share code, notes, and snippets.

@electronicbites
Created October 8, 2018 19:48
Show Gist options
  • Save electronicbites/a5aa9dc0837ca7bbe86a6cffd1e6ff1d to your computer and use it in GitHub Desktop.
Save electronicbites/a5aa9dc0837ca7bbe86a6cffd1e6ff1d to your computer and use it in GitHub Desktop.
class Animal
def speak
puts "?"
end
end
class Cat < Animal
def speak
puts "miau"
end
end
class Dog < Animal
def speak
puts "wuff"
end
end
ant = Animal.new
ant.speak
wuffi = Dog.new
wuffi.speak
mietzi = Cat.new
mietzi.speak
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment