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