Class: DepartedResults
- Inherits:
-
Object
- Object
- DepartedResults
- Defined in:
- lib/FlightXML2REST.rb
Instance Attribute Summary collapse
-
#departedResult ⇒ Object
Returns the value of attribute departedResult.
Instance Method Summary collapse
-
#initialize(departedResult = nil) ⇒ DepartedResults
constructor
A new instance of DepartedResults.
Constructor Details
#initialize(departedResult = nil) ⇒ DepartedResults
Returns a new instance of DepartedResults.
736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 |
# File 'lib/FlightXML2REST.rb', line 736 def initialize(departedResult = nil) begin rawDepartedResult = JSON.parse(departedResult) departedResult = rawDepartedResult['DepartedResult'] @departedResult = DepartureStruct.new([], departedResult['next_offset']) departedResult['departures'].each do |departure| @departedResult.departures << DepartureFlightStruct.new(departure['actualarrivaltime'], departure['actualdeparturetime'], departure['aircrafttype'], departure['destination'], departure['destinationCity'], departure['destinationName'], departure['estimatedarrivaltime'], departure['ident'], departure['origin'], departure['originCity'], departure['originName'] ) end rescue raise FlightAwareError.new(rawDepartedResult['error']).error end end |
Instance Attribute Details
#departedResult ⇒ Object
Returns the value of attribute departedResult.
735 736 737 |
# File 'lib/FlightXML2REST.rb', line 735 def departedResult @departedResult end |