Class: FleetArrivedResults

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(fleetArrivedResult = nil) ⇒ FleetArrivedResults

Returns a new instance of FleetArrivedResults.



912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
# File 'lib/FlightXML2REST.rb', line 912

def initialize(fleetArrivedResult = nil)
  begin
    rawFleetArrivedResult = JSON.parse(fleetArrivedResult)
    fleetArrivedResult = rawFleetArrivedResult['FleetArrivedResult']
    @fleetArrivedResult = ArrivalStruct.new([], fleetArrivedResult['next_offset'])
    fleetArrivedResult['arrivals'].each do |arrival|
      @fleetArrivedResult.arrivals << ArrivalFlightStruct.new(arrival['actualarrivaltime'],
                                                              arrival['actualdeparturetime'],
                                                              arrival['aircrafttype'],
                                                              arrival['destination'],
                                                              arrival['destinationCity'],
                                                              arrival['destinationName'],
                                                              arrival['ident'],
                                                              arrival['origin'],
                                                              arrival['originCity'],
                                                              arrival['originName']
                                                              )
    end
  rescue
      raise FlightAwareError.new(rawFleetArrivedResult['error']).error
  end
end

Instance Attribute Details

#fleetArrivedResultObject

Returns the value of attribute fleetArrivedResult.



911
912
913
# File 'lib/FlightXML2REST.rb', line 911

def fleetArrivedResult
  @fleetArrivedResult
end