Class: Skyscanner::Flight

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

Overview

Flight info

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#carriersObject (readonly)

Returns the value of attribute carriers.



30
31
32
# File 'lib/movlog/route.rb', line 30

def carriers
  @carriers
end

#dateObject (readonly)

Returns the value of attribute date.



30
31
32
# File 'lib/movlog/route.rb', line 30

def date
  @date
end

#destinationObject (readonly)

Returns the value of attribute destination.



31
32
33
# File 'lib/movlog/route.rb', line 31

def destination
  @destination
end

#directObject (readonly)

Returns the value of attribute direct.



30
31
32
# File 'lib/movlog/route.rb', line 30

def direct
  @direct
end

#min_priceObject (readonly)

Returns the value of attribute min_price.



30
31
32
# File 'lib/movlog/route.rb', line 30

def min_price
  @min_price
end

#originObject (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_hashObject



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