Class: FlightInfoExResults
- Inherits:
-
Object
- Object
- FlightInfoExResults
- Defined in:
- lib/FlightXML2REST.rb
Instance Attribute Summary collapse
-
#flightInfoExResult ⇒ Object
Returns the value of attribute flightInfoExResult.
Instance Method Summary collapse
-
#initialize(flightInfoExResult = nil) ⇒ FlightInfoExResults
constructor
A new instance of FlightInfoExResults.
Constructor Details
#initialize(flightInfoExResult = nil) ⇒ FlightInfoExResults
Returns a new instance of FlightInfoExResults.
1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 |
# File 'lib/FlightXML2REST.rb', line 1155 def initialize(flightInfoExResult = nil) begin rawFlightInfoResult = JSON.parse(flightInfoExResult) flightInfoExResult = rawFlightInfoResult['FlightInfoExResult'] @flightInfoExResult = FlightInfoExStruct.new([], flightInfoExResult['next_offset']) flightInfoExResult['flights'].each do |flight| @flightInfoExResult.flights << FlightExStruct.new(flight['actualarrivaltime'], flight['actualdeparturetime'], flight['aircrafttype'], flight['destination'], flight['destinationCity'], flight['destinationName'], flight['diverted'], flight['estimatedarrivaltime'], flight['faFlightID'], flight['filed_airspeed_kts'], flight['filed_airspeed_mach'], flight['filed_altitude'], flight['filed_departuretime'], flight['filed_ete'], flight['filed_time'], flight['ident'], flight['origin'], flight['originCity'], flight['originName'], flight['route'] ) end rescue raise FlightAwareError.new(rawFlightInfoResult['error']).error end end |
Instance Attribute Details
#flightInfoExResult ⇒ Object
Returns the value of attribute flightInfoExResult.
1154 1155 1156 |
# File 'lib/FlightXML2REST.rb', line 1154 def flightInfoExResult @flightInfoExResult end |