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 +4 -4
- data/README.md +1 -1
- data/lib/wego/booking.rb +3 -2
- data/lib/wego/search.rb +9 -5
- data/lib/wego/version.rb +1 -1
- data/spec/wego/booking_spec.rb +6 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ac2f78bb23e1df3bf6c9904d37967a5f3ee4e3b1
|
4
|
+
data.tar.gz: 7abd22b3e1e13996acd4ee8da00b1bd8de9274d8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d3bf94d2c6f9f2fcfb5d4a0f62bf89664a5850092d8586a357fcb9bc85b49400e6e717c5c54e9088a60f30cb4c4d4479383f1459dd2dee921100b4a35d55f99b
|
7
|
+
data.tar.gz: 0fb2441e7af3384d2b2f27701578de4a0dacf3edb5b0b0367cd48657377885f198c7df7d0f5543a57d8b593e8042e6b65d760d1a2451f75eab8e461e56fd6dd8
|
data/README.md
CHANGED
data/lib/wego/booking.rb
CHANGED
@@ -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
|
data/lib/wego/search.rb
CHANGED
@@ -2,11 +2,15 @@ require "wego/result"
|
|
2
2
|
|
3
3
|
module Wego
|
4
4
|
class Search
|
5
|
-
def self.create(
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
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
|
|
data/lib/wego/version.rb
CHANGED
data/spec/wego/booking_spec.rb
CHANGED
@@ -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,
|
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
|
+
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-
|
11
|
+
date: 2016-07-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|