wego 0.1.4 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: af58bf962cd2fbfa922eb201889b6583ad83d8f6
4
- data.tar.gz: 8d00f570cbb98a78cf040f8dbcab9203b77bf9ab
3
+ metadata.gz: ac2f78bb23e1df3bf6c9904d37967a5f3ee4e3b1
4
+ data.tar.gz: 7abd22b3e1e13996acd4ee8da00b1bd8de9274d8
5
5
  SHA512:
6
- metadata.gz: 8b5da6c82c7c7e4fcc89ab55a69be3f3ffe267dbedbb248149dc83112829b926e6790b7331bfe6b4e616d1e6c7c30163cb28a24a384828acaa7b077d665a3d4a
7
- data.tar.gz: 25c6657964c62d6f00247e6769c96c70f2f10d2d70c834533ebf9eece90ed768cc00dc64e7e45a3861d8c8ae52804ccc6584d27c9d2172c3c6666d44d60e9cfc
6
+ metadata.gz: d3bf94d2c6f9f2fcfb5d4a0f62bf89664a5850092d8586a357fcb9bc85b49400e6e717c5c54e9088a60f30cb4c4d4479383f1459dd2dee921100b4a35d55f99b
7
+ data.tar.gz: 0fb2441e7af3384d2b2f27701578de4a0dacf3edb5b0b0367cd48657377885f198c7df7d0f5543a57d8b593e8042e6b65d760d1a2451f75eab8e461e56fd6dd8
data/README.md CHANGED
@@ -113,7 +113,7 @@ their partners' sites.
113
113
 
114
114
  ```ruby
115
115
  Wego::Booking.url_for(
116
- search_id, hotel_id: hotel_id, room_rate_id: room_rate_id
116
+ search_id, hotel_id: hotel_id, room_rate_id: room_rate_id, locale: "en"
117
117
  )
118
118
  ```
119
119
 
@@ -1,10 +1,11 @@
1
1
  module Wego
2
2
  class Booking
3
- def self.url_for(search_id, hotel_id:, room_rate_id:)
3
+ def self.url_for(search_id, hotel_id:, room_rate_id:, **options)
4
4
  Wego::Client.new(
5
5
  "search/redirect/#{search_id}",
6
6
  hotel_id: hotel_id,
7
- room_rate_id: room_rate_id
7
+ room_rate_id: room_rate_id,
8
+ **options
8
9
  ).url
9
10
  end
10
11
  end
@@ -2,11 +2,15 @@ require "wego/result"
2
2
 
3
3
  module Wego
4
4
  class Search
5
- def self.create(search_terms)
6
- search_terms[:check_in] = Wego.format_date(search_terms[:check_in])
7
- search_terms[:check_out] = Wego.format_date(search_terms[:check_out])
8
-
9
- Wego.get_resource "search/new", search_terms
5
+ def self.create(location_id:, check_in:, check_out:, user_ip:, **options)
6
+ Wego.get_resource(
7
+ "search/new",
8
+ location_id: location_id,
9
+ check_in: Wego.format_date(check_in),
10
+ check_out: Wego.format_date(check_out),
11
+ user_ip: user_ip,
12
+ **options
13
+ )
10
14
  end
11
15
  end
12
16
 
@@ -1,3 +1,3 @@
1
1
  module Wego
2
- VERSION = "0.1.4".freeze
2
+ VERSION = "0.1.5".freeze
3
3
  end
@@ -4,11 +4,15 @@ describe Wego::Booking do
4
4
  describe "#redirect_url" do
5
5
  it "prepares the redirect url" do
6
6
  booking_url = Wego::Booking.url_for(
7
- 716_073_46, hotel_id: 273_451, room_rate_id: 12
7
+ 716_073_46,
8
+ hotel_id: 273_451,
9
+ room_rate_id: 12,
10
+ locale: "en",
11
+ currency_code: "GBP"
8
12
  )
9
13
 
10
14
  expect(booking_url).to include("search/redirect/71607346?")
11
- expect(booking_url).to include("hotel_id=273451&room_rate_id=12")
15
+ expect(booking_url).to include("hotel_id=273451&room_rate_id=12&locale")
12
16
  end
13
17
  end
14
18
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wego
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Abu Nashir
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-07-19 00:00:00.000000000 Z
11
+ date: 2016-07-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client