Class: Suitcase::Hotel::Reservation

Inherits:
Object
  • Object
show all
Defined in:
lib/suitcase/hotel/reservation.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(info) ⇒ Reservation

Internal: Create a new Reservation from the API response.

info - The Hash of information returned from the API.



9
10
11
12
# File 'lib/suitcase/hotel/reservation.rb', line 9

def initialize(info)
  @itinerary_id, @confirmation_numbers = info[:itinerary_id], [info[:confirmation_numbers]].flatten
  @surcharges = info[:surcharges]
end

Instance Attribute Details

#confirmation_numbersObject

Returns the value of attribute confirmation_numbers.



4
5
6
# File 'lib/suitcase/hotel/reservation.rb', line 4

def confirmation_numbers
  @confirmation_numbers
end

#itinerary_idObject

Returns the value of attribute itinerary_id.



4
5
6
# File 'lib/suitcase/hotel/reservation.rb', line 4

def itinerary_id
  @itinerary_id
end

#rawObject

Returns the value of attribute raw.



4
5
6
# File 'lib/suitcase/hotel/reservation.rb', line 4

def raw
  @raw
end

#surchargesObject

Returns the value of attribute surcharges.



4
5
6
# File 'lib/suitcase/hotel/reservation.rb', line 4

def surcharges
  @surcharges
end