Changed the Recipe to Train and Passenger information.#21
Changed the Recipe to Train and Passenger information.#21dnourie wants to merge 2 commits intoRubyoffRails:masterfrom
Conversation
There was a problem hiding this comment.
GREAT job with putting info as a method on train. 👍
|
most excellent submission! The only change I'd make. Below, you coming "data" with "presentation". That is, the Passenger = Struct.new(:name, :train) do
def trip
puts "#{name} is riding the #{train} while on vacation."
end
endInstead, I would have the Passenger = Struct.new(:name, :train) do
def trip
"#{name} is riding the #{train} while on vacation."
end
end
first_passenger = Passenger.new("Sharon", "amtrack")
puts first_passenger.trip |
|
Thank you. That makes sense and is helpful. I made the correction. Dana On Mon, May 5, 2014 at 12:03 PM, Jesse Wolgamott
Dana Nourie |
|
Coooool! 👍 |
I added an extra line at the end that wasn't necessary for printing, but I thought it was neat when I tried it out. I had not heard of Struct before!