Created
March 28, 2010 17:59
-
-
Save zuchmanski/346915 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
| class Animal | |
| attr_accessor :name | |
| def say | |
| puts "Wrrrrr" | |
| end | |
| def sleep | |
| puts "Sleeeping" | |
| end | |
| end | |
| class Human < Animal | |
| attr_accessor :surname | |
| def say | |
| puts "Hello World" | |
| end | |
| end | |
| dog = Animal.new | |
| me = Human.new | |
| dog.say | |
| dog.sleep | |
| me.say | |
| me.sleep |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment