Class: Rome2rio::FlightLeg

Inherits:
Object
  • Object
show all
Defined in:
lib/rome2rio/response/flight_leg.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(json) ⇒ FlightLeg

Returns a new instance of FlightLeg.



4
5
6
7
8
# File 'lib/rome2rio/response/flight_leg.rb', line 4

def initialize(json)
  @days = DayFlags.parse(json["days"])
  @hops = []
  json["hops"].each { |hop| @hops << FlightHop.new(hop) }
end

Instance Attribute Details

#daysObject (readonly)

Returns the value of attribute days.



3
4
5
# File 'lib/rome2rio/response/flight_leg.rb', line 3

def days
  @days
end

#hopsObject (readonly)

Returns the value of attribute hops.



3
4
5
# File 'lib/rome2rio/response/flight_leg.rb', line 3

def hops
  @hops
end