Class: SearchBirdseyeInFlightResults

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(searchBirdseyeInFlightResult = nil) ⇒ SearchBirdseyeInFlightResults

Returns a new instance of SearchBirdseyeInFlightResults.



2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
# File 'lib/FlightXML2REST.rb', line 2315

def initialize(searchBirdseyeInFlightResult = nil)
  begin
    rawSearchBirdseyeInFlightResult = JSON.parse(searchBirdseyeInFlightResult)
    searchBirdseyeInFlightResult = rawSearchBirdseyeInFlightResult['SearchBirdseyeInFlightResult']
    @searchBirdseyeInFlightResult = InFlightStruct.new([], searchBirdseyeInFlightResult['next_offset'])
    searchBirdseyeInFlightResult['aircraft'].each do |aircraft|
      @searchBirdseyeInFlightResult.aircraft << InFlightAircraftStruct.new(aircraft['altitude'],
                                                                           aircraft['altitudeChange'],
                                                                           aircraft['altitudeStatus'],
                                                                           aircraft['departureTime'],
                                                                           aircraft['destination'],
                                                                           aircraft['faFlightID'],
                                                                           aircraft['firstPositionTime'],
                                                                           aircraft['groundspeed'],
                                                                           aircraft['heading'],
                                                                           aircraft['highLatitude'],
                                                                           aircraft['highLongitude'],
                                                                           aircraft['ident'],
                                                                           aircraft['latitude'],
                                                                           aircraft['longitude'],
                                                                           aircraft['lowLatitude'],
                                                                           aircraft['lowLongitude'],
                                                                           aircraft['origin'],
                                                                           aircraft['prefix'],
                                                                           aircraft['suffix'],
                                                                           aircraft['timeout'],
                                                                           aircraft['timestamp'],
                                                                           aircraft['type'],
                                                                           aircraft['updateType'],
                                                                           aircraft['waypoints']
                                                                          )
    end
  rescue
      raise FlightAwareError.new(rawSearchBirdseyeInFlightResult['error']).error
  end
end

Instance Attribute Details

#searchBirdseyeInFlightResultObject

Returns the value of attribute searchBirdseyeInFlightResult.



2314
2315
2316
# File 'lib/FlightXML2REST.rb', line 2314

def searchBirdseyeInFlightResult
  @searchBirdseyeInFlightResult
end