Class: GetHistoricalTrackResults

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(getHistoricalTrackResult = nil) ⇒ GetHistoricalTrackResults

Returns a new instance of GetHistoricalTrackResults.



1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
# File 'lib/FlightXML2REST.rb', line 1427

def initialize(getHistoricalTrackResult = nil)
  begin
    rawGetHistoricalTrackResult = JSON.parse(getHistoricalTrackResult)
    getHistoricalTrackResult = rawGetHistoricalTrackResult['GetHistoricalTrackResult']
    @getHistoricalTrackResult = ArrayOfTrackStruct.new()
    getHistoricalTrackResult['data'].each do |data|
      @getHistoricalTrackResult.data << TrackStruct.new(data['altitude'],
                                     data['altitudeChange'],
                                     data['altitudeStatus'],
                                     data['groundsped'],
                                     data['latitude'],
                                     data['longitude'],
                                     data['timestamp'],
                                     data['updateType']
                                    )

    end
  rescue
      raise FlightAwareError.new(rawGetHistoricalTrackResult['error']).error
  end
end

Instance Attribute Details

#getHistoricalTrackResultObject

Returns the value of attribute getHistoricalTrackResult.



1426
1427
1428
# File 'lib/FlightXML2REST.rb', line 1426

def getHistoricalTrackResult
  @getHistoricalTrackResult
end