Class: FleetArrivedResults
- Inherits:
-
Object
- Object
- FleetArrivedResults
- Defined in:
- lib/FlightXML2REST.rb
Instance Attribute Summary collapse
-
#fleetArrivedResult ⇒ Object
Returns the value of attribute fleetArrivedResult.
Instance Method Summary collapse
-
#initialize(fleetArrivedResult = nil) ⇒ FleetArrivedResults
constructor
A new instance of FleetArrivedResults.
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
#fleetArrivedResult ⇒ Object
Returns the value of attribute fleetArrivedResult.
911 912 913 |
# File 'lib/FlightXML2REST.rb', line 911 def fleetArrivedResult @fleetArrivedResult end |