suitcase 1.6.5 → 1.6.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -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
@@ -78,7 +78,13 @@ module Suitcase
78
78
  res = session.post uri.request_uri, {}
79
79
  parsed = JSON.parse res.body
80
80
 
81
- Reservation.new(itinerary_id: parsed["HotelRoomReservationResponse"]["itineraryId"], confirmation_numbers: parsed["HotelRoomReservationResponse"]["confirmationNumbers"])
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.
@@ -1,3 +1,3 @@
1
1
  module Suitcase
2
- VERSION = "1.6.5"
2
+ VERSION = "1.6.6"
3
3
  end
@@ -39,6 +39,7 @@ describe Suitcase::Hotel::Room do
39
39
 
40
40
  it "returns a Suitcase::Reservation" do
41
41
  reservation = @room.reserve!(@info)
42
+ binding.pry
42
43
  reservation.must_be_kind_of(Suitcase::Hotel::Reservation)
43
44
  end
44
45
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: suitcase
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.5
4
+ version: 1.6.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: