perhaps I should watch the video again...it is not clear to me what should
be a hash vs a Struct and how to construct it the way you want it. I will
start over again.


On Tue, Jan 14, 2014 at 12:46 PM, Jesse Wolgamott
<notifications@github.com>wrote:

> In train.rb:
>
> > @@ -0,0 +1,40 @@
> > +Passenger = Struct.new(:name)
> > +Train = Struct.new(:destination, :number_of_cars, :caboose, :number_of_engine)
> > +
> > +passengers = [Passenger.new(name: 'Bill Smith'), Passenger.new(name: 'Sarah Robot')]
> > +train = Train.new( passengers, {destination: 'New York', number_of_engines: 4, caboose: true, number_of_cars: 5})
> > +
> > +puts "Destination: #{train.destination}"
> > +puts "Cars: #{train.number_of_cars}"
> > +puts "Caboose: #{train.caboose}"
> > +puts "Passengers: #{passengers}"
>
> So, the destination seems wrong, as well as Cars, Caboose, and Passengers.
>
> If your definition for train is Struct.new(:destination, :number_of_cars,
> :caboose, :number_of_engine) then what are you sending in?
>
> Train = Struct.new(:destination, :number_of_cars, :caboose, :number_of_engine)
>
> There isn't a place for passengers.
>
> And to simplify things, let's change
>
> train = Train.new( passengers, {destination: 'New York', number_of_engines: 4, caboose: true, number_of_cars: 5})
>
> to
>
> train = Train.new( passengers, 'New York', 4, true, 5)
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/RubyoffRails/recipe-hash/pull/14/files#r8868170>
> .
>



-- 

Robert Jewell
1.914.400.5219