Class: Rome2rio::TransitItinerary
- Inherits:
-
Object
- Object
- Rome2rio::TransitItinerary
- Defined in:
- lib/rome2rio/response/transit_itinerary.rb
Instance Attribute Summary collapse
-
#legs ⇒ Object
readonly
Returns the value of attribute legs.
Instance Method Summary collapse
-
#initialize(json) ⇒ TransitItinerary
constructor
A new instance of TransitItinerary.
Constructor Details
#initialize(json) ⇒ TransitItinerary
Returns a new instance of TransitItinerary.
4 5 6 7 |
# File 'lib/rome2rio/response/transit_itinerary.rb', line 4 def initialize(json) @legs = [] json["legs"].each { |leg| @legs << TransitLeg.new(leg) } end |
Instance Attribute Details
#legs ⇒ Object (readonly)
Returns the value of attribute legs.
3 4 5 |
# File 'lib/rome2rio/response/transit_itinerary.rb', line 3 def legs @legs end |