Class: RoutesBetweenAirportsExResults

Inherits:
Object
  • Object
show all
Defined in:
lib/FlightXML2REST.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(routesBetweenAirportsExResult = nil) ⇒ RoutesBetweenAirportsExResults

Returns a new instance of RoutesBetweenAirportsExResults.



2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
# File 'lib/FlightXML2REST.rb', line 2112

def initialize(routesBetweenAirportsExResult = nil)
  begin
    rawRoutesBetweenAirportsExResult = JSON.parse(routesBetwenAirportsExResult)
    routesBetweenAirportsExResult = rawRoutesBetweenAirportsExResult['RoutesBetweenAirportsExResult']
    @routesBetweenAirportsExResult = ArrayOfRoutesBetweenAirportsExStruct.new([], routesBetweenAirportsExResult['next_offset'])
    routesBetweenAirportsExResult['data'].each do |route|
      @routesBetweenAirportsExResult.data << RoutesBetweenAirportsExStruct.new(route['count'],
                                                                               route['filedAltitude_max'],
                                                                               route['filedAltitude_min'],
                                                                               route['last_departuretime'],
                                                                               route['route']
                                                                              )

    end
  rescue
      raise FlightAwareError.new(rawRoutesBetweenAirportsExResult['error']).error
  end
end

Instance Attribute Details

#routesBetweenAirportsExResultObject

Returns the value of attribute routesBetweenAirportsExResult.



2111
2112
2113
# File 'lib/FlightXML2REST.rb', line 2111

def routesBetweenAirportsExResult
  @routesBetweenAirportsExResult
end