Class: RoutesBetweenAirportsResults

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(routesBetweenAirportsResult = nil) ⇒ RoutesBetweenAirportsResults

Returns a new instance of RoutesBetweenAirportsResults.



2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
# File 'lib/FlightXML2REST.rb', line 2058

def initialize(routesBetweenAirportsResult = nil)
  begin
    rawRoutesBetweenAirportsResult = JSON.parse(routesBetweenAirportsResult)
    routesBetweenAirportsResult = rawRoutesBetweenAirportsResult['RoutesBetweenAirportsResult']
    @routesBetweenAirportsResult = ArrayOfRoutesBetweenAirportsStruct.new()
    routesBetweenAirportsResult['data'].each do |route|
      @routesBetweenAirportsResult.data << RoutesBetweenAirportsStruct.new(route['count'],
                                                                            route['filedAltitude'],
                                                                            route['route']
                                                                           )

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

Instance Attribute Details

#routesBetweenAirportsResultObject

Returns the value of attribute routesBetweenAirportsResult.



2057
2058
2059
# File 'lib/FlightXML2REST.rb', line 2057

def routesBetweenAirportsResult
  @routesBetweenAirportsResult
end