Class: AirlineInsightResults
- Inherits:
-
Object
- Object
- AirlineInsightResults
- Defined in:
- lib/FlightXML2REST.rb
Instance Attribute Summary collapse
-
#airlineInsightResult ⇒ Object
Returns the value of attribute airlineInsightResult.
Instance Method Summary collapse
-
#initialize(airlineInsightResult = nil) ⇒ AirlineInsightResults
constructor
A new instance of AirlineInsightResults.
Constructor Details
#initialize(airlineInsightResult = nil) ⇒ AirlineInsightResults
Returns a new instance of AirlineInsightResults.
277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 |
# File 'lib/FlightXML2REST.rb', line 277 def initialize(airlineInsightResult = nil) begin rawAirlineInsightResult = JSON.parse(airlineInsightResult) airlineInsightResult = rawAirlineInsightResult['AirlineInsightResult'] @airlineInsightResult = ArrayOfAirlineInsightStruct.new([], airlineInsightResult['end_date'], airlineInsightResult['start_date']) airlineInsightResult['data'].each do |data| @airlineInsightResult.data << AirlineInsightStruct.new(data['carrier'], data['destination'], data['fare_max'], data['fare_median'], data['fare_min'], data['flights_performed'], data['flights_scheduled'], data['layover'], data['opcarrier'], data['origin'], data['percent'], data['total_mail'], data['total_passengers'], data['total_payload'], data['total_seats'] ) end rescue raise FlightAwareError.new(rawInboundFlightInfoResult['error']).error end end |
Instance Attribute Details
#airlineInsightResult ⇒ Object
Returns the value of attribute airlineInsightResult.
276 277 278 |
# File 'lib/FlightXML2REST.rb', line 276 def airlineInsightResult @airlineInsightResult end |