Class: FlightInfoResults

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(flightInfoResult = nil) ⇒ FlightInfoResults

Returns a new instance of FlightInfoResults.



937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
# File 'lib/FlightXML2REST.rb', line 937

def initialize(flightInfoResult = nil)
  flightInfoResult = JSON.parse(flightInfoResult)['FlightInfoResult']
  @flightInfoResult = FlightInfoStruct.new([], flightInfoResult['next_offset'])
  flightInfoResult['flights'].each do |flight|
    @flightInfoResult.flights << FlightStruct.new(flight['actualarrivaltime'],
                                                  flight['actualdeparturetime'],
                                                  flight['aircrafttype'],
                                                  flight['destination'],
                                                  flight['destinationCity'],
                                                  flight['destinationName'],
                                                  flight['diverted'],
                                                  flight['estimatedarrivaltime'],
                                                  flight['filed_airspeed_kts'],
                                                  flight['filed_airspeed_mach'],
                                                  flight['filed_altitude'],
                                                  flight['filed_departuretime'],
                                                  flight['filed_ete'],
                                                  flight['filed_time'],
                                                  flight['ident'],
                                                  flight['origin'],
                                                  flight['originCity'],
                                                  flight['originName'],
                                                  flight['route']
                                                 )
  end
end

Instance Attribute Details

#flightInfoResultObject

Returns the value of attribute flightInfoResult.



936
937
938
# File 'lib/FlightXML2REST.rb', line 936

def flightInfoResult
  @flightInfoResult
end