Created
January 21, 2015 22:20
-
-
Save troyleach/1f2afe9a55b26112f47d to your computer and use it in GitHub Desktop.
screencast 16
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
| #screen cast 16 | |
| # so I guess I @cheated!! | |
| class Car | |
| def new_car | |
| @mercedes = [] | |
| end | |
| def engine | |
| @mercedes.push("engine") | |
| end | |
| def wheels | |
| @mercedes.push("wheels") | |
| end | |
| def radio | |
| @mercedes.push("radio") | |
| end | |
| def cupholder | |
| @mercedes.push("cup holder") | |
| end | |
| def assembled_car | |
| @mercedes | |
| end | |
| end | |
| newCar = Car.new | |
| newCar.new_car | |
| newCar.engine | |
| newCar.wheels | |
| newCar.radio | |
| newCar.cupholder | |
| p newCar.assembled_car |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Great!