Class: Rome2rio::FlightHop

Inherits:
Object
  • Object
show all
Defined in:
lib/rome2rio/response/flight_hop.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(json) ⇒ FlightHop

Returns a new instance of FlightHop.



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/rome2rio/response/flight_hop.rb', line 7

def initialize(json)
  @sCode = json["sCode"]
  @tCode = json["tCode"]
  @sTerminal = json["sTerminal"]
  @tTerminal = json["tTerminal"]
  @sTime = json["sTime"]
  @tTime = json["tTime"]
  @airline = json["airline"]
  @flight = json["flight"]
  @duration = json["duration"]
  @aircraft = json["aircraft"]
  @dayChange = json["dayChange"] if json["dayChange"]
  @lDuration = json["lDuration"] if json["lDuration"]
  @lDayChange = json["lDayChange"] if json["lDayChange"]
  @codeshares = []
  json["codeshares"].each { |codeshare| @codeshares << Codeshare.new(codeshare) }
end

Instance Attribute Details

#aircraftObject (readonly)

Returns the value of attribute aircraft.



3
4
5
# File 'lib/rome2rio/response/flight_hop.rb', line 3

def aircraft
  @aircraft
end

#airlineObject (readonly)

Returns the value of attribute airline.



3
4
5
# File 'lib/rome2rio/response/flight_hop.rb', line 3

def airline
  @airline
end

#codesharesObject (readonly)

Returns the value of attribute codeshares.



3
4
5
# File 'lib/rome2rio/response/flight_hop.rb', line 3

def codeshares
  @codeshares
end

#dayChangeObject (readonly)

Returns the value of attribute dayChange.



3
4
5
# File 'lib/rome2rio/response/flight_hop.rb', line 3

def dayChange
  @dayChange
end

#durationObject (readonly)

Returns the value of attribute duration.



3
4
5
# File 'lib/rome2rio/response/flight_hop.rb', line 3

def duration
  @duration
end

#flightObject (readonly)

Returns the value of attribute flight.



3
4
5
# File 'lib/rome2rio/response/flight_hop.rb', line 3

def flight
  @flight
end

#lDayChangeObject (readonly)

Returns the value of attribute lDayChange.



3
4
5
# File 'lib/rome2rio/response/flight_hop.rb', line 3

def lDayChange
  @lDayChange
end

#lDurationObject (readonly)

Returns the value of attribute lDuration.



3
4
5
# File 'lib/rome2rio/response/flight_hop.rb', line 3

def lDuration
  @lDuration
end

#sCodeObject (readonly)

Returns the value of attribute sCode.



3
4
5
# File 'lib/rome2rio/response/flight_hop.rb', line 3

def sCode
  @sCode
end

#sTerminalObject (readonly)

Returns the value of attribute sTerminal.



3
4
5
# File 'lib/rome2rio/response/flight_hop.rb', line 3

def sTerminal
  @sTerminal
end

#sTimeObject (readonly)

Returns the value of attribute sTime.



3
4
5
# File 'lib/rome2rio/response/flight_hop.rb', line 3

def sTime
  @sTime
end

#tCodeObject (readonly)

Returns the value of attribute tCode.



3
4
5
# File 'lib/rome2rio/response/flight_hop.rb', line 3

def tCode
  @tCode
end

#tTerminalObject (readonly)

Returns the value of attribute tTerminal.



3
4
5
# File 'lib/rome2rio/response/flight_hop.rb', line 3

def tTerminal
  @tTerminal
end

#tTimeObject (readonly)

Returns the value of attribute tTime.



3
4
5
# File 'lib/rome2rio/response/flight_hop.rb', line 3

def tTime
  @tTime
end