Class: Ratis::Itinerary
- Inherits:
-
Object
- Object
- Ratis::Itinerary
- Defined in:
- lib/ratis/itinerary.rb
Instance Attribute Summary collapse
-
#co2_auto ⇒ Object
Returns the value of attribute co2_auto.
-
#co2_transit ⇒ Object
Returns the value of attribute co2_transit.
-
#final_walk_dir ⇒ Object
Returns the value of attribute final_walk_dir.
-
#legs ⇒ Object
Returns the value of attribute legs.
-
#reduced_fare ⇒ Object
Returns the value of attribute reduced_fare.
-
#regular_fare ⇒ Object
Returns the value of attribute regular_fare.
-
#trace_info ⇒ Object
Returns the value of attribute trace_info.
-
#transit_time ⇒ Object
Returns the value of attribute transit_time.
Instance Method Summary collapse
-
#initialize(response) ⇒ Itinerary
constructor
A new instance of Itinerary.
Constructor Details
#initialize(response) ⇒ Itinerary
Returns a new instance of Itinerary.
7 8 9 10 11 12 13 14 15 16 |
# File 'lib/ratis/itinerary.rb', line 7 def initialize(response) @co2_auto = response[:co2auto].to_f @co2_transit = response[:co2transit].to_f @final_walk_dir = response[:finalwalkdir] @reduced_fare = response[:reducedfare].to_f @regular_fare = response[:regularfare].to_f @transit_time = response[:transittime].to_i @trace_info = response[:traceinfo] @legs = response.to_array(:legs, :leg).map { |l| Hashie::Mash.new l } end |
Instance Attribute Details
#co2_auto ⇒ Object
Returns the value of attribute co2_auto.
5 6 7 |
# File 'lib/ratis/itinerary.rb', line 5 def co2_auto @co2_auto end |
#co2_transit ⇒ Object
Returns the value of attribute co2_transit.
5 6 7 |
# File 'lib/ratis/itinerary.rb', line 5 def co2_transit @co2_transit end |
#final_walk_dir ⇒ Object
Returns the value of attribute final_walk_dir.
5 6 7 |
# File 'lib/ratis/itinerary.rb', line 5 def final_walk_dir @final_walk_dir end |
#legs ⇒ Object
Returns the value of attribute legs.
5 6 7 |
# File 'lib/ratis/itinerary.rb', line 5 def legs @legs end |
#reduced_fare ⇒ Object
Returns the value of attribute reduced_fare.
5 6 7 |
# File 'lib/ratis/itinerary.rb', line 5 def reduced_fare @reduced_fare end |
#regular_fare ⇒ Object
Returns the value of attribute regular_fare.
5 6 7 |
# File 'lib/ratis/itinerary.rb', line 5 def regular_fare @regular_fare end |
#trace_info ⇒ Object
Returns the value of attribute trace_info.
5 6 7 |
# File 'lib/ratis/itinerary.rb', line 5 def trace_info @trace_info end |
#transit_time ⇒ Object
Returns the value of attribute transit_time.
5 6 7 |
# File 'lib/ratis/itinerary.rb', line 5 def transit_time @transit_time end |