Class: NTafResults

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(nTafResult = nil) ⇒ NTafResults

Returns a new instance of NTafResults.



1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
# File 'lib/FlightXML2REST.rb', line 1994

def initialize(nTafResult = nil)
  begin
    rawNTafResult = JSON.parse(nTafResult)
    nTafResult = JSON.parse(nTafResult)['NTafResult']
    @nTafResult = TafStruct.new(nTafResult['airport'],
                                nTafResult['forecast'].each { |v| v},
                                nTafResult['timeString']
                               )
  rescue
      raise FlightAwareError.new(rawNTafResultResult['error']).error
  end
end

Instance Attribute Details

#nTafResultObject

Returns the value of attribute nTafResult.



1993
1994
1995
# File 'lib/FlightXML2REST.rb', line 1993

def nTafResult
  @nTafResult
end