Class: FlightStats::FlightLeg

Inherits:
Resource
  • Object
show all
Defined in:
lib/flightstats/flight_leg.rb

Instance Attribute Summary collapse

Attributes inherited from Resource

#attributes, #etag, #response, #uri

Instance Method Summary collapse

Methods inherited from Resource

from_json, from_parsed_json, from_response, #initialize, string_to_model, string_to_model_with_caching, #to_param, #underscore_with_caching

Constructor Details

This class inherits a constructor from FlightStats::Resource

Instance Attribute Details

#arrival_airport_fs_codeObject

Returns the value of attribute arrival_airport_fs_code.



3
4
5
# File 'lib/flightstats/flight_leg.rb', line 3

def arrival_airport_fs_code
  @arrival_airport_fs_code
end

#arrival_date_adjustmentObject

Returns the value of attribute arrival_date_adjustment.



3
4
5
# File 'lib/flightstats/flight_leg.rb', line 3

def arrival_date_adjustment
  @arrival_date_adjustment
end

#arrival_terminalObject

Returns the value of attribute arrival_terminal.



3
4
5
# File 'lib/flightstats/flight_leg.rb', line 3

def arrival_terminal
  @arrival_terminal
end

#arrival_timeObject

Returns the value of attribute arrival_time.



3
4
5
# File 'lib/flightstats/flight_leg.rb', line 3

def arrival_time
  @arrival_time
end

#carrier_fs_codeObject

Returns the value of attribute carrier_fs_code.



3
4
5
# File 'lib/flightstats/flight_leg.rb', line 3

def carrier_fs_code
  @carrier_fs_code
end

#codeshareObject

Returns the value of attribute codeshare.



3
4
5
# File 'lib/flightstats/flight_leg.rb', line 3

def codeshare
  @codeshare
end

#departure_airport_fs_codeObject

Returns the value of attribute departure_airport_fs_code.



3
4
5
# File 'lib/flightstats/flight_leg.rb', line 3

def departure_airport_fs_code
  @departure_airport_fs_code
end

#departure_date_adjustmentObject

Returns the value of attribute departure_date_adjustment.



3
4
5
# File 'lib/flightstats/flight_leg.rb', line 3

def departure_date_adjustment
  @departure_date_adjustment
end

#departure_terminalObject

Returns the value of attribute departure_terminal.



3
4
5
# File 'lib/flightstats/flight_leg.rb', line 3

def departure_terminal
  @departure_terminal
end

#departure_timeObject

Returns the value of attribute departure_time.



3
4
5
# File 'lib/flightstats/flight_leg.rb', line 3

def departure_time
  @departure_time
end

#distance_milesObject

Returns the value of attribute distance_miles.



3
4
5
# File 'lib/flightstats/flight_leg.rb', line 3

def distance_miles
  @distance_miles
end

#equipment_codesObject

Returns the value of attribute equipment_codes.



3
4
5
# File 'lib/flightstats/flight_leg.rb', line 3

def equipment_codes
  @equipment_codes
end

#flight_duration_minutesObject

Returns the value of attribute flight_duration_minutes.



3
4
5
# File 'lib/flightstats/flight_leg.rb', line 3

def flight_duration_minutes
  @flight_duration_minutes
end

#flight_numberObject

Returns the value of attribute flight_number.



3
4
5
# File 'lib/flightstats/flight_leg.rb', line 3

def flight_number
  @flight_number
end

#layover_duration_minutesObject

Returns the value of attribute layover_duration_minutes.



3
4
5
# File 'lib/flightstats/flight_leg.rb', line 3

def layover_duration_minutes
  @layover_duration_minutes
end

#operatorObject

Returns the value of attribute operator.



3
4
5
# File 'lib/flightstats/flight_leg.rb', line 3

def operator
  @operator
end

#stop_codesObject

Returns the value of attribute stop_codes.



3
4
5
# File 'lib/flightstats/flight_leg.rb', line 3

def stop_codes
  @stop_codes
end

#wetlease_infoObject

Returns the value of attribute wetlease_info.



3
4
5
# File 'lib/flightstats/flight_leg.rb', line 3

def wetlease_info
  @wetlease_info
end

Instance Method Details

#to_sObject



22
23
24
# File 'lib/flightstats/flight_leg.rb', line 22

def to_s
  "#{operator ? operator.carrier_fs_code : carrier_fs_code}#{flight_number}: #{departure_airport_fs_code} at #{departure_time} - #{arrival_airport_fs_code} at #{arrival_time} (+#{arrival_date_adjustment}) #{distance_miles} miles"
end