Class: InboundFlightInfoResults

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(inboundFlightInfoResult = nil) ⇒ InboundFlightInfoResults

Returns a new instance of InboundFlightInfoResults.



1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
# File 'lib/FlightXML2REST.rb', line 1538

def initialize(inboundFlightInfoResult = nil)
  begin
    rawInboundFlightInfoResult = JSON.parse(inboundFlightInfoResult)
    inboundFlightInfoResult = rawInboundFlightInforResult['InboundFlightInfoResult']
    @inboundFlightInfoResult = FlightExStruct.new(inboundFlightInfoResult['actualarrivaltime'],
                                                  inboundFlightInfoResult['actualdeparturetime'],
                                                  inboundFlightInfoResult['aircrafttype'],
                                                  inboundFlightInfoResult['destination'],
                                                  inboundFlightInfoResult['destinationCity'],
                                                  inboundFlightInfoResult['destinationName'],
                                                  inboundFlightInfoResult['diverted'],
                                                  inboundFlightInfoResult['estimatedarrivaltime'],
                                                  inboundFlightInfoResult['faFlightID'],
                                                  inboundFlightInfoResult['filed_airspeed_kts'],
                                                  inboundFlightInfoResult['filed_airspeed_mach'],
                                                  inboundFlightInfoResult['filed_altitude'],
                                                  inboundFlightInfoResult['filed_departuretime'],
                                                  inboundFlightInfoResult['filed_ete'],
                                                  inboundFlightInfoResult['filed_time'],
                                                  inboundFlightInfoResult['ident'],
                                                  inboundFlightInfoResult['origin'],
                                                  inboundFlightInfoResult['originCity'],
                                                  inboundFlightInfoResult['originName'],
                                                  inboundFlightInfoResult['route']
                                                 )
  rescue
      raise FlightAwareError.new(rawInboundFlightInfoResult['error']).error
  end
end

Instance Attribute Details

#inboundFlightInfoResultObject

Returns the value of attribute inboundFlightInfoResult.



1537
1538
1539
# File 'lib/FlightXML2REST.rb', line 1537

def inboundFlightInfoResult
  @inboundFlightInfoResult
end