Class: GetLastTrackResults

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(getLastTrackResult = nil) ⇒ GetLastTrackResults

Returns a new instance of GetLastTrackResults.



1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
# File 'lib/FlightXML2REST.rb', line 1501

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

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

Instance Attribute Details

#getLastTrackResultObject

Returns the value of attribute getLastTrackResult.



1500
1501
1502
# File 'lib/FlightXML2REST.rb', line 1500

def getLastTrackResult
  @getLastTrackResult
end