suitcase 1.6.5 → 1.6.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/suitcase/hotel/reservation.rb +2 -1
- data/lib/suitcase/hotel/room.rb +7 -1
- data/lib/suitcase/version.rb +1 -1
- data/test/hotels/room_test.rb +1 -0
- metadata +1 -1
@@ -1,13 +1,14 @@
|
|
1
1
|
module Suitcase
|
2
2
|
class Hotel
|
3
3
|
class Reservation
|
4
|
-
attr_accessor :itinerary_id, :confirmation_numbers
|
4
|
+
attr_accessor :itinerary_id, :confirmation_numbers, :raw, :surcharges
|
5
5
|
|
6
6
|
# Internal: Create a new Reservation from the API response.
|
7
7
|
#
|
8
8
|
# info - The Hash of information returned from the API.
|
9
9
|
def initialize(info)
|
10
10
|
@itinerary_id, @confirmation_numbers = info[:itinerary_id], [info[:confirmation_numbers]].flatten
|
11
|
+
@surcharges = info[:surcharges]
|
11
12
|
end
|
12
13
|
end
|
13
14
|
end
|
data/lib/suitcase/hotel/room.rb
CHANGED
@@ -78,7 +78,13 @@ module Suitcase
|
|
78
78
|
res = session.post uri.request_uri, {}
|
79
79
|
parsed = JSON.parse res.body
|
80
80
|
|
81
|
-
|
81
|
+
|
82
|
+
r = Reservation.new(itinerary_id: parsed["HotelRoomReservationResponse"]["itineraryId"],
|
83
|
+
confirmation_numbers: parsed["HotelRoomReservationResponse"]["confirmationNumbers"],
|
84
|
+
surcharges: [parsed["HotelRoomReservationResponse"]["RateInfo"]["ChargeableRateInfo"]["Surcharges"]["Surcharge"]].flatten.map { |s| Surcharge.parse(s) }
|
85
|
+
)
|
86
|
+
r.raw = parsed
|
87
|
+
r
|
82
88
|
end
|
83
89
|
|
84
90
|
# Public: The chargeable rate for the Hotel room.
|
data/lib/suitcase/version.rb
CHANGED
data/test/hotels/room_test.rb
CHANGED