Most programs have data -- here we talk about 3 ways to store data in a program: the ever-present Hash, the cool-kid Struct, and a regular Class.
Change our recipe hash into a hash that that describes a Train.
It should have
- a current city, a number of engines, a number of cars, and a caboose.
- output the train formatted nicely.
- Create a passenger Struct that has a name and a train (from above)
- [http://www.weeatt.com/recipes/guacamole](Guacamole Recipe)
- [http://rubyfiddle.com/riddles/924d3](Working Recipe RubyFiddle as Hash)
- [http://rubyfiddle.com/riddles/f4f45](Working Recipe RubyFiddle as Struct)
Copyright: Jesse Wolgamott, MIT License (See LICENSE)