Class: AirlineFlightSchedulesResults

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(airlineFlightSchedulesResult = nil) ⇒ AirlineFlightSchedulesResults

Returns a new instance of AirlineFlightSchedulesResults.



144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
# File 'lib/FlightXML2REST.rb', line 144

def initialize(airlineFlightSchedulesResult = nil)
  begin
    rawAirlineFlightSchedulesResult = JSON.parse(airlineFlightSchedulesResult)
    airlineFlightSchedulesResult = rawAirlineFlightSchedulesResult['AirlineFlightSchedulesResult']
    @airlineFlightSchedulesResult = ArrayOfAirlineFlightScheduleStruct.new([], airlineFlightSchedulesResult['next_offset'])
    airlineFlightSchedulesResult['data'].each do |data|
      @airlineFlightSchedulesResult.data << AirlineFlightScheduleStruct.new(data['actual_ident'],
                                                          data['aircrafttype'],
                                                          data['arrivaltime'],
                                                          data['departuretime'],
                                                          data['destination'],
                                                          data['ident'],
                                                          data['meal_service'],
                                                          data['origin'],
                                                          data['seats_cabin_business'],
                                                          data['seats_cabin_coach'],
                                                          data['seats_cabin_first']
                                                         )
    end
  rescue
      raise FlightAwareError.new(rawAirlineFlightSchedulesResult['error']).error
  end
end

Instance Attribute Details

#airlineFlightSchedulesResultObject

Returns the value of attribute airlineFlightSchedulesResult.



143
144
145
# File 'lib/FlightXML2REST.rb', line 143

def airlineFlightSchedulesResult
  @airlineFlightSchedulesResult
end