Created
June 2, 2014 14:39
-
-
Save StephenFiser/1d7472613870fb180d9d 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 | |
| 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