Class: Skyscanner::Flight
- Inherits:
-
Object
- Object
- Skyscanner::Flight
- Defined in:
- lib/movlog/route.rb
Overview
Flight info
Instance Attribute Summary collapse
-
#carriers ⇒ Object
readonly
Returns the value of attribute carriers.
-
#date ⇒ Object
readonly
Returns the value of attribute date.
-
#destination ⇒ Object
readonly
Returns the value of attribute destination.
-
#direct ⇒ Object
readonly
Returns the value of attribute direct.
-
#min_price ⇒ Object
readonly
Returns the value of attribute min_price.
-
#origin ⇒ Object
readonly
Returns the value of attribute origin.
Instance Method Summary collapse
-
#initialize(data) ⇒ Flight
constructor
A new instance of Flight.
- #to_hash ⇒ Object
Constructor Details
#initialize(data) ⇒ Flight
Returns a new instance of Flight.
33 34 35 36 37 38 39 40 |
# File 'lib/movlog/route.rb', line 33 def initialize(data) @min_price = data[:min_price] @direct = data[:direct] @carriers = data[:carriers] @origin = data[:origin] @destination = data[:destination] @date = data[:date] end |
Instance Attribute Details
#carriers ⇒ Object (readonly)
Returns the value of attribute carriers.
30 31 32 |
# File 'lib/movlog/route.rb', line 30 def carriers @carriers end |
#date ⇒ Object (readonly)
Returns the value of attribute date.
30 31 32 |
# File 'lib/movlog/route.rb', line 30 def date @date end |
#destination ⇒ Object (readonly)
Returns the value of attribute destination.
31 32 33 |
# File 'lib/movlog/route.rb', line 31 def destination @destination end |
#direct ⇒ Object (readonly)
Returns the value of attribute direct.
30 31 32 |
# File 'lib/movlog/route.rb', line 30 def direct @direct end |
#min_price ⇒ Object (readonly)
Returns the value of attribute min_price.
30 31 32 |
# File 'lib/movlog/route.rb', line 30 def min_price @min_price end |
#origin ⇒ Object (readonly)
Returns the value of attribute origin.
31 32 33 |
# File 'lib/movlog/route.rb', line 31 def origin @origin end |
Instance Method Details
#to_hash ⇒ Object
42 43 44 45 46 |
# File 'lib/movlog/route.rb', line 42 def to_hash { min_price: @min_price, direct: @direct, carriers: @carriers, origin: @origin.to_hash, destination: @destination.to_hash, date: @date } end |