Class: EnrouteResults
- Inherits:
-
Object
- Object
- EnrouteResults
- Defined in:
- lib/FlightXML2REST.rb
Instance Attribute Summary collapse
-
#enrouteResult ⇒ Object
Returns the value of attribute enrouteResult.
Instance Method Summary collapse
-
#initialize(enrouteResult = nil) ⇒ EnrouteResults
constructor
A new instance of EnrouteResults.
Constructor Details
#initialize(enrouteResult = nil) ⇒ EnrouteResults
Returns a new instance of EnrouteResults.
825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 |
# File 'lib/FlightXML2REST.rb', line 825 def initialize(enrouteResult = nil) begin rawEnrouteResult = JSON.parse(enrouteResult) enrouteResult = rawEnrouteResult['EnrouteResult'] @enrouteResult = EnrouteStruct.new([], enrouteResult['next_offset']) enrouteResult['enroute'].each do |enroute| @enrouteResult.enroute << EnrouteFlightStruct.new(enroute['actualdeparturetime'], enroute['aircrafttype'], enroute['destination'], enroute['destinationCity'], enroute['destinationName'], enroute['estimatedarrivaltime'], enroute['filed_departuretime'], enroute['ident'], enroute['origin'], enroute['originCity'], enroute['originName'] ) end rescue raise FlightAwareError.new(rawEnrouteResult['error']).error end end |
Instance Attribute Details
#enrouteResult ⇒ Object
Returns the value of attribute enrouteResult.
824 825 826 |
# File 'lib/FlightXML2REST.rb', line 824 def enrouteResult @enrouteResult end |