hotels_pro 0.2
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.
- checksums.yaml +7 -0
- data/.gitignore +17 -0
- data/.rspec +2 -0
- data/.travis.yml +7 -0
- data/Gemfile +4 -0
- data/LICENSE +22 -0
- data/README.md +91 -0
- data/Rakefile +2 -0
- data/hotels_pro.gemspec +24 -0
- data/lib/hotels_pro.rb +69 -0
- data/lib/hotels_pro/api/api_method.rb +29 -0
- data/lib/hotels_pro/api/api_params.rb +29 -0
- data/lib/hotels_pro/api/elements/book_info.rb +27 -0
- data/lib/hotels_pro/api/elements/daily_rate.rb +12 -0
- data/lib/hotels_pro/api/elements/filter.rb +13 -0
- data/lib/hotels_pro/api/elements/hotel.rb +22 -0
- data/lib/hotels_pro/api/elements/lead_traveller.rb +15 -0
- data/lib/hotels_pro/api/elements/pax.rb +16 -0
- data/lib/hotels_pro/api/elements/pax_array.rb +17 -0
- data/lib/hotels_pro/api/elements/policy.rb +15 -0
- data/lib/hotels_pro/api/elements/room_response.rb +16 -0
- data/lib/hotels_pro/api/methods/allocate_hotel_code.rb +21 -0
- data/lib/hotels_pro/api/methods/amend_hotel_booking.rb +27 -0
- data/lib/hotels_pro/api/methods/cancel_hotel_booking.rb +20 -0
- data/lib/hotels_pro/api/methods/get_available_hotel.rb +28 -0
- data/lib/hotels_pro/api/methods/get_balance.rb +18 -0
- data/lib/hotels_pro/api/methods/get_hotel_booking_status.rb +21 -0
- data/lib/hotels_pro/api/methods/get_hotel_cancellation_policy.rb +19 -0
- data/lib/hotels_pro/api/methods/make_hotel_booking.rb +24 -0
- data/lib/hotels_pro/configuration.rb +14 -0
- data/lib/hotels_pro/query.rb +34 -0
- data/lib/hotels_pro/request.rb +43 -0
- data/lib/hotels_pro/response.rb +33 -0
- data/lib/hotels_pro/stubs.rb +66 -0
- data/lib/hotels_pro/stubs/stub.rb +23 -0
- data/lib/hotels_pro/underscorer.rb +21 -0
- data/lib/hotels_pro/version.rb +3 -0
- data/spec/api_params_helper.rb +8 -0
- data/spec/fixtures/allocate_hotel_code.json +1 -0
- data/spec/fixtures/amend_hotel_booking.json +1 -0
- data/spec/fixtures/cancel_hotel_booking.json +1 -0
- data/spec/fixtures/get_available_hotel.json +1 -0
- data/spec/fixtures/get_balance.json +1 -0
- data/spec/fixtures/get_hotel_booking_status.json +1 -0
- data/spec/fixtures/get_hotel_cancellation_policy.json +1 -0
- data/spec/fixtures/make_hotel_booking.json +1 -0
- data/spec/hotels_pro/api/.gitkeep +0 -0
- data/spec/hotels_pro/api/api_method_spec.rb +14 -0
- data/spec/hotels_pro/api/api_params_spec.rb +36 -0
- data/spec/hotels_pro/api/elements/pax_array_spec.rb +14 -0
- data/spec/hotels_pro/api/methods/allocate_hotel_code_spec.rb +34 -0
- data/spec/hotels_pro/api/methods/amend_hotel_booking_spec.rb +79 -0
- data/spec/hotels_pro/api/methods/cancel_hotel_booking_spec.rb +32 -0
- data/spec/hotels_pro/api/methods/get_available_hotel_spec.rb +83 -0
- data/spec/hotels_pro/api/methods/get_balance_spec.rb +26 -0
- data/spec/hotels_pro/api/methods/get_hotel_booking_status_spec.rb +31 -0
- data/spec/hotels_pro/api/methods/get_hotel_cancellation_policy_spec.rb +31 -0
- data/spec/hotels_pro/api/methods/make_hotel_booking_spec.rb +66 -0
- data/spec/hotels_pro/query_spec.rb +52 -0
- data/spec/hotels_pro/request_spec.rb +73 -0
- data/spec/hotels_pro/response_spec.rb +24 -0
- data/spec/hotels_pro/stubs/stub_spec.rb +41 -0
- data/spec/hotels_pro/stubs_spec.rb +37 -0
- data/spec/hotels_pro/underscorer_spec.rb +33 -0
- data/spec/request_helper.rb +6 -0
- data/spec/spec_helper.rb +15 -0
- metadata +222 -0
@@ -0,0 +1,66 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe HotelsPro::Api::Methods::MakeHotelBooking do
|
4
|
+
include RequestHelper
|
5
|
+
|
6
|
+
it "should build correct api params hash" do
|
7
|
+
method = HotelsPro::Api::Methods::MakeHotelBooking.new(
|
8
|
+
:process_id => "HF-56017745",
|
9
|
+
:agency_reference_number => "999",
|
10
|
+
:lead_traveller_info => HotelsPro::Api::Elements::LeadTraveller.new(
|
11
|
+
:pax_info => HotelsPro::Api::Elements::Pax.new(:pax_type => "Adult", :title => "Mr", :first_name => "John", :last_name => "Doe"),
|
12
|
+
:nationality => "US"
|
13
|
+
),
|
14
|
+
:other_traveller_info => [
|
15
|
+
HotelsPro::Api::Elements::Pax.new(:pax_type => "Adult", :age => 30, :title => "Mrs", :first_name => "Amanda", :last_name => "Doe")
|
16
|
+
],
|
17
|
+
:preferences => "nonSmoking",
|
18
|
+
:note => "I like french fries"
|
19
|
+
)
|
20
|
+
|
21
|
+
method.to_api_params.should == {
|
22
|
+
"processId" => "HF-56017745",
|
23
|
+
"agencyReferenceNumber" => "999",
|
24
|
+
"leadTravellerInfo" => {
|
25
|
+
"paxInfo" => {
|
26
|
+
"paxType" => "Adult",
|
27
|
+
"title" => "Mr",
|
28
|
+
"firstName" => "John",
|
29
|
+
"lastName" => "Doe"
|
30
|
+
},
|
31
|
+
"nationality" => "US"
|
32
|
+
},
|
33
|
+
"otherTravellerInfo" => [
|
34
|
+
{ "paxType" => "Adult", "age" => "30", "title" => "Mrs", "firstName" => "Amanda", "lastName" => "Doe" }
|
35
|
+
],
|
36
|
+
"preferences" => "nonSmoking",
|
37
|
+
"note" => "I like french fries"
|
38
|
+
}
|
39
|
+
end
|
40
|
+
|
41
|
+
it "should return result when performed" do
|
42
|
+
HotelsPro::Stubs.make_hotel_booking.response(fixture('make_hotel_booking'))
|
43
|
+
|
44
|
+
method = HotelsPro::Api::Methods::MakeHotelBooking.new(
|
45
|
+
:process_id => "HF-56017745",
|
46
|
+
:agency_reference_number => "999",
|
47
|
+
:lead_traveller_info => HotelsPro::Api::Elements::LeadTraveller.new(
|
48
|
+
:pax_info => HotelsPro::Api::Elements::Pax.new(:pax_type => "Adult", :title => "Mr", :first_name => "John", :last_name => "Doe"),
|
49
|
+
:nationality => "US"
|
50
|
+
),
|
51
|
+
:other_traveller_info => [
|
52
|
+
HotelsPro::Api::Elements::Pax.new(:pax_type => "Adult", :age => 30, :title => "Mrs", :first_name => "Amanda", :last_name => "Doe")
|
53
|
+
],
|
54
|
+
:preferences => "nonSmoking",
|
55
|
+
:note => "I like french fries"
|
56
|
+
)
|
57
|
+
|
58
|
+
result = method.perform
|
59
|
+
|
60
|
+
result.should be_instance_of HotelsPro::Api::Methods::MakeHotelBooking::Result
|
61
|
+
result.response_id.should == 5756635
|
62
|
+
result.tracking_id.should == "XI-HE-70838364"
|
63
|
+
result.hotel_booking_info.should be_instance_of HotelsPro::Api::Elements::BookInfo
|
64
|
+
result.hotel_booking_info.hotel_code.should == "US2HZR"
|
65
|
+
end
|
66
|
+
end
|
@@ -0,0 +1,52 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe HotelsPro::Query do
|
4
|
+
it "should encode hash" do
|
5
|
+
params = { "a" => "1", "b" => "2" }
|
6
|
+
|
7
|
+
query = HotelsPro::Query.new(params)
|
8
|
+
query.to_s.should include("a=1")
|
9
|
+
query.to_s.should include("b=2")
|
10
|
+
end
|
11
|
+
|
12
|
+
it "should encode hashes of hashes" do
|
13
|
+
params = { "a" => { "b" => "2", "c" => "3" } }
|
14
|
+
|
15
|
+
query = HotelsPro::Query.new(params)
|
16
|
+
query.to_s.should include("a[b]=2")
|
17
|
+
query.to_s.should include("a[c]=3")
|
18
|
+
end
|
19
|
+
|
20
|
+
it "should encode hashes of arrays" do
|
21
|
+
params = { "a" => ["2", "3"] }
|
22
|
+
|
23
|
+
query = HotelsPro::Query.new(params)
|
24
|
+
query.to_s.should include("a[0]=2")
|
25
|
+
query.to_s.should include("a[1]=3")
|
26
|
+
end
|
27
|
+
|
28
|
+
it "should encode hashes of arrays of hashes" do
|
29
|
+
params = { "a" => [{ "b" => "2" }, { "c" => "3" }] }
|
30
|
+
|
31
|
+
query = HotelsPro::Query.new(params)
|
32
|
+
query.to_s.should include("a[0][b]=2")
|
33
|
+
query.to_s.should include("a[1][c]=3")
|
34
|
+
end
|
35
|
+
|
36
|
+
it "should encode hashes of arrays of arrays of hashes" do
|
37
|
+
params = { "a" => [[{ "b" => "2" }, { "c" => "3" }], [{ "d" => "4" }, { "e" => "5" }]] }
|
38
|
+
|
39
|
+
query = HotelsPro::Query.new(params)
|
40
|
+
query.to_s.should include("a[0][0][b]=2")
|
41
|
+
query.to_s.should include("a[0][1][c]=3")
|
42
|
+
query.to_s.should include("a[1][0][d]=4")
|
43
|
+
query.to_s.should include("a[1][1][e]=5")
|
44
|
+
end
|
45
|
+
|
46
|
+
it "should escape values" do
|
47
|
+
params = { "a" => "foo bar" }
|
48
|
+
|
49
|
+
query = HotelsPro::Query.new(params)
|
50
|
+
query.to_s.should == "?a=foo%20bar"
|
51
|
+
end
|
52
|
+
end
|
@@ -0,0 +1,73 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe HotelsPro::Request do
|
4
|
+
include RequestHelper
|
5
|
+
|
6
|
+
before(:each) do
|
7
|
+
@request = HotelsPro::Request.new("getAvailableHotel", :param1 => "value1", :param2 => "value2")
|
8
|
+
end
|
9
|
+
|
10
|
+
it "should be defined with params hash" do
|
11
|
+
@request.params.should == { :param1 => "value1", :param2 => "value2" }
|
12
|
+
end
|
13
|
+
|
14
|
+
it "should build query from params, api method and api key" do
|
15
|
+
query = @request.query
|
16
|
+
|
17
|
+
query.should =~ /param1=value1/
|
18
|
+
query.should =~ /param2=value2/
|
19
|
+
query.should =~ /method=getAvailableHotel/
|
20
|
+
query.should =~ /apiKey=123/
|
21
|
+
end
|
22
|
+
|
23
|
+
it "should build uri from api url and query" do
|
24
|
+
@request.uri.should == "#{HotelsPro.configuration.api_url}#{@request.query}"
|
25
|
+
end
|
26
|
+
|
27
|
+
it "should return response" do
|
28
|
+
HotelsPro::Stubs.get_available_hotel.response(fixture("get_available_hotel"))
|
29
|
+
|
30
|
+
response = @request.perform
|
31
|
+
response.should be_an_instance_of HotelsPro::Response
|
32
|
+
end
|
33
|
+
|
34
|
+
context "when only_stubs is true" do
|
35
|
+
before do
|
36
|
+
@only_stubs = HotelsPro.configuration.only_stubs
|
37
|
+
HotelsPro.configure do |config|
|
38
|
+
config.only_stubs = true
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
after do
|
43
|
+
HotelsPro.configure do |config|
|
44
|
+
config.only_stubs = @only_stubs
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
it "should raise exception when performing unstubbed request" do
|
49
|
+
lambda{ @request.perform }.should raise_exception(HotelsPro::UnstubbedRequest)
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
context "when only_stubs is false" do
|
54
|
+
before do
|
55
|
+
@only_stubs = HotelsPro.configuration.only_stubs
|
56
|
+
HotelsPro.configure do |config|
|
57
|
+
config.only_stubs = false
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
after do
|
62
|
+
HotelsPro.configure do |config|
|
63
|
+
config.only_stubs = @only_stubs
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
it "should not raise exception when performing unstubbed request" do
|
68
|
+
# Stub it with Typhoeus
|
69
|
+
Typhoeus::Hydra.hydra.stub(:get, @request.uri).and_return(Typhoeus::Response.new(:status => 200, :body => "''", :headers => '', :time => 0.1))
|
70
|
+
lambda{ @request.perform }.should_not raise_exception
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe HotelsPro::Response do
|
4
|
+
it "should detect response errors" do
|
5
|
+
response = HotelsPro::Response.new('[0, "error message"]')
|
6
|
+
response.error?.should be_true
|
7
|
+
response.error.should be_instance_of(HotelsPro::ErrorResponse)
|
8
|
+
response.error.message.should == "error message"
|
9
|
+
end
|
10
|
+
|
11
|
+
it "should detect JSON parsing errors" do
|
12
|
+
response = HotelsPro::Response.new('non-json')
|
13
|
+
response.error?.should be_true
|
14
|
+
response.error.should be_instance_of(HotelsPro::RemoteError)
|
15
|
+
response.error.message.should == "Remote API down."
|
16
|
+
end
|
17
|
+
|
18
|
+
it "should parse and underscore json response" do
|
19
|
+
response = HotelsPro::Response.new('{"paramOne": "value1"}')
|
20
|
+
response.error?.should be_false
|
21
|
+
response.error.should be_nil
|
22
|
+
response.data.should == { "param_one" => "value1" }
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,41 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe HotelsPro::Stubs::Stub do
|
4
|
+
it "should set response and return self (be chainable)" do
|
5
|
+
matcher = lambda { |request| true }
|
6
|
+
the_stub = HotelsPro::Stubs::Stub.new("foo", matcher)
|
7
|
+
the_stub.response("bar").should == the_stub
|
8
|
+
the_stub.response.should == "bar"
|
9
|
+
end
|
10
|
+
|
11
|
+
it "should not match request with different api method" do
|
12
|
+
matcher = lambda { |request| true }
|
13
|
+
the_stub = HotelsPro::Stubs::Stub.new("foo", matcher).response("response")
|
14
|
+
request = stub(:api_method => "bar")
|
15
|
+
|
16
|
+
the_stub.matches?(request).should be_false
|
17
|
+
end
|
18
|
+
|
19
|
+
it "should not match request if matcher evaluates to false" do
|
20
|
+
matcher = lambda { |request| false }
|
21
|
+
the_stub = HotelsPro::Stubs::Stub.new("foo", matcher).response("response")
|
22
|
+
request = stub(:api_method => "foo")
|
23
|
+
|
24
|
+
the_stub.matches?(request).should be_false
|
25
|
+
end
|
26
|
+
|
27
|
+
it "should match request when api method is correct and matcher evaluates to true" do
|
28
|
+
matcher = lambda { |request| true }
|
29
|
+
the_stub = HotelsPro::Stubs::Stub.new("foo", matcher).response("response")
|
30
|
+
request = stub(:api_method => "foo")
|
31
|
+
|
32
|
+
the_stub.matches?(request).should be_true
|
33
|
+
end
|
34
|
+
|
35
|
+
it "should match request when api method is correct and matcher is not set" do
|
36
|
+
the_stub = HotelsPro::Stubs::Stub.new("foo").response("response")
|
37
|
+
request = stub(:api_method => "foo")
|
38
|
+
|
39
|
+
the_stub.matches?(request).should be_true
|
40
|
+
end
|
41
|
+
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe HotelsPro::Stubs do
|
4
|
+
before do
|
5
|
+
HotelsPro::Stubs.clear
|
6
|
+
end
|
7
|
+
|
8
|
+
it "should add a stub" do
|
9
|
+
matcher = lambda { |request| true }
|
10
|
+
HotelsPro::Stubs.get_available_hotel(matcher).response("response")
|
11
|
+
|
12
|
+
HotelsPro::Stubs.stubs.size.should == 1
|
13
|
+
end
|
14
|
+
|
15
|
+
context "with stub added" do
|
16
|
+
before do
|
17
|
+
matcher = lambda { |request| request.foo == "bar" }
|
18
|
+
HotelsPro::Stubs.get_available_hotel(matcher).response("response")
|
19
|
+
HotelsPro::Stubs.stubs.size.should == 1
|
20
|
+
end
|
21
|
+
|
22
|
+
it "should clear stubs" do
|
23
|
+
HotelsPro::Stubs.clear
|
24
|
+
HotelsPro::Stubs.stubs.size.should == 0
|
25
|
+
end
|
26
|
+
|
27
|
+
it "should return response when request matches a stub" do
|
28
|
+
request = stub(:api_method => 'getAvailableHotel', :foo => "bar")
|
29
|
+
HotelsPro::Stubs.match(request).should == "response"
|
30
|
+
end
|
31
|
+
|
32
|
+
it "should return nil when request does not match a stub" do
|
33
|
+
request = stub(:api_method => 'getAvailableHotel', :foo => "baz")
|
34
|
+
HotelsPro::Stubs.match(request).should be_nil
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe HotelsPro::Underscorer do
|
4
|
+
before do
|
5
|
+
@u = Object.new
|
6
|
+
@u.extend HotelsPro::Underscorer
|
7
|
+
end
|
8
|
+
|
9
|
+
it "should underscore hash keys" do
|
10
|
+
underscored = @u.underscore("paramOne" => "value1", "paramTwo" => "value2")
|
11
|
+
underscored.should == { "param_one" => "value1", "param_two" => "value2" }
|
12
|
+
end
|
13
|
+
|
14
|
+
it "should underscore nested hash's keys" do
|
15
|
+
underscored = @u.underscore("a" => { "paramTwo" => "value2" })
|
16
|
+
underscored.should == { "a" => { "param_two" => "value2" } }
|
17
|
+
end
|
18
|
+
|
19
|
+
it "should underscore keys of hashes found in arrays" do
|
20
|
+
underscored = @u.underscore( [{ "paramOne" => "value1" }, { "paramTwo" => "value2" }])
|
21
|
+
underscored.should == [{ "param_one" => "value1" }, { "param_two" => "value2" }]
|
22
|
+
end
|
23
|
+
|
24
|
+
it "should underscore keys of hashes found in nested arrays" do
|
25
|
+
underscored = @u.underscore( "a" => [{ "paramOne" => "value1" }, { "paramTwo" => "value2" }])
|
26
|
+
underscored.should == { "a" => [{ "param_one" => "value1" }, { "param_two" => "value2" }]}
|
27
|
+
end
|
28
|
+
|
29
|
+
it "should not fail on non-hashes or non-arrays" do
|
30
|
+
underscored = @u.underscore("foo")
|
31
|
+
underscored.should == "foo"
|
32
|
+
end
|
33
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'bundler/setup'
|
3
|
+
require 'hotels_pro'
|
4
|
+
|
5
|
+
require 'api_params_helper'
|
6
|
+
require 'request_helper'
|
7
|
+
|
8
|
+
HotelsPro.configure do |config|
|
9
|
+
config.api_key = "123"
|
10
|
+
config.only_stubs = true
|
11
|
+
end
|
12
|
+
|
13
|
+
RSpec.configure do |config|
|
14
|
+
config.before(:each) { HotelsPro::Stubs.clear }
|
15
|
+
end
|
metadata
ADDED
@@ -0,0 +1,222 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: hotels_pro
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: '0.2'
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Michał Szajbe
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2013-10-17 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: activesupport
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - '>='
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - '>='
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: json
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - '>='
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - '>='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: typhoeus
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - '>='
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: virtus
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - '>='
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rspec
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - '>='
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - '>='
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: ZenTest
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - '>='
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - '>='
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
description: HotelsPro API wrapper
|
98
|
+
email:
|
99
|
+
- michal.szajbe@gmail.com
|
100
|
+
executables: []
|
101
|
+
extensions: []
|
102
|
+
extra_rdoc_files: []
|
103
|
+
files:
|
104
|
+
- .gitignore
|
105
|
+
- .rspec
|
106
|
+
- .travis.yml
|
107
|
+
- Gemfile
|
108
|
+
- LICENSE
|
109
|
+
- README.md
|
110
|
+
- Rakefile
|
111
|
+
- hotels_pro.gemspec
|
112
|
+
- lib/hotels_pro.rb
|
113
|
+
- lib/hotels_pro/api/api_method.rb
|
114
|
+
- lib/hotels_pro/api/api_params.rb
|
115
|
+
- lib/hotels_pro/api/elements/book_info.rb
|
116
|
+
- lib/hotels_pro/api/elements/daily_rate.rb
|
117
|
+
- lib/hotels_pro/api/elements/filter.rb
|
118
|
+
- lib/hotels_pro/api/elements/hotel.rb
|
119
|
+
- lib/hotels_pro/api/elements/lead_traveller.rb
|
120
|
+
- lib/hotels_pro/api/elements/pax.rb
|
121
|
+
- lib/hotels_pro/api/elements/pax_array.rb
|
122
|
+
- lib/hotels_pro/api/elements/policy.rb
|
123
|
+
- lib/hotels_pro/api/elements/room_response.rb
|
124
|
+
- lib/hotels_pro/api/methods/allocate_hotel_code.rb
|
125
|
+
- lib/hotels_pro/api/methods/amend_hotel_booking.rb
|
126
|
+
- lib/hotels_pro/api/methods/cancel_hotel_booking.rb
|
127
|
+
- lib/hotels_pro/api/methods/get_available_hotel.rb
|
128
|
+
- lib/hotels_pro/api/methods/get_balance.rb
|
129
|
+
- lib/hotels_pro/api/methods/get_hotel_booking_status.rb
|
130
|
+
- lib/hotels_pro/api/methods/get_hotel_cancellation_policy.rb
|
131
|
+
- lib/hotels_pro/api/methods/make_hotel_booking.rb
|
132
|
+
- lib/hotels_pro/configuration.rb
|
133
|
+
- lib/hotels_pro/query.rb
|
134
|
+
- lib/hotels_pro/request.rb
|
135
|
+
- lib/hotels_pro/response.rb
|
136
|
+
- lib/hotels_pro/stubs.rb
|
137
|
+
- lib/hotels_pro/stubs/stub.rb
|
138
|
+
- lib/hotels_pro/underscorer.rb
|
139
|
+
- lib/hotels_pro/version.rb
|
140
|
+
- spec/api_params_helper.rb
|
141
|
+
- spec/fixtures/allocate_hotel_code.json
|
142
|
+
- spec/fixtures/amend_hotel_booking.json
|
143
|
+
- spec/fixtures/cancel_hotel_booking.json
|
144
|
+
- spec/fixtures/get_available_hotel.json
|
145
|
+
- spec/fixtures/get_balance.json
|
146
|
+
- spec/fixtures/get_hotel_booking_status.json
|
147
|
+
- spec/fixtures/get_hotel_cancellation_policy.json
|
148
|
+
- spec/fixtures/make_hotel_booking.json
|
149
|
+
- spec/hotels_pro/api/.gitkeep
|
150
|
+
- spec/hotels_pro/api/api_method_spec.rb
|
151
|
+
- spec/hotels_pro/api/api_params_spec.rb
|
152
|
+
- spec/hotels_pro/api/elements/pax_array_spec.rb
|
153
|
+
- spec/hotels_pro/api/methods/allocate_hotel_code_spec.rb
|
154
|
+
- spec/hotels_pro/api/methods/amend_hotel_booking_spec.rb
|
155
|
+
- spec/hotels_pro/api/methods/cancel_hotel_booking_spec.rb
|
156
|
+
- spec/hotels_pro/api/methods/get_available_hotel_spec.rb
|
157
|
+
- spec/hotels_pro/api/methods/get_balance_spec.rb
|
158
|
+
- spec/hotels_pro/api/methods/get_hotel_booking_status_spec.rb
|
159
|
+
- spec/hotels_pro/api/methods/get_hotel_cancellation_policy_spec.rb
|
160
|
+
- spec/hotels_pro/api/methods/make_hotel_booking_spec.rb
|
161
|
+
- spec/hotels_pro/query_spec.rb
|
162
|
+
- spec/hotels_pro/request_spec.rb
|
163
|
+
- spec/hotels_pro/response_spec.rb
|
164
|
+
- spec/hotels_pro/stubs/stub_spec.rb
|
165
|
+
- spec/hotels_pro/stubs_spec.rb
|
166
|
+
- spec/hotels_pro/underscorer_spec.rb
|
167
|
+
- spec/request_helper.rb
|
168
|
+
- spec/spec_helper.rb
|
169
|
+
homepage: ''
|
170
|
+
licenses: []
|
171
|
+
metadata: {}
|
172
|
+
post_install_message:
|
173
|
+
rdoc_options: []
|
174
|
+
require_paths:
|
175
|
+
- lib
|
176
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
177
|
+
requirements:
|
178
|
+
- - '>='
|
179
|
+
- !ruby/object:Gem::Version
|
180
|
+
version: '0'
|
181
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
182
|
+
requirements:
|
183
|
+
- - '>='
|
184
|
+
- !ruby/object:Gem::Version
|
185
|
+
version: '0'
|
186
|
+
requirements: []
|
187
|
+
rubyforge_project:
|
188
|
+
rubygems_version: 2.0.0
|
189
|
+
signing_key:
|
190
|
+
specification_version: 4
|
191
|
+
summary: HotelsPro API wrapper
|
192
|
+
test_files:
|
193
|
+
- spec/api_params_helper.rb
|
194
|
+
- spec/fixtures/allocate_hotel_code.json
|
195
|
+
- spec/fixtures/amend_hotel_booking.json
|
196
|
+
- spec/fixtures/cancel_hotel_booking.json
|
197
|
+
- spec/fixtures/get_available_hotel.json
|
198
|
+
- spec/fixtures/get_balance.json
|
199
|
+
- spec/fixtures/get_hotel_booking_status.json
|
200
|
+
- spec/fixtures/get_hotel_cancellation_policy.json
|
201
|
+
- spec/fixtures/make_hotel_booking.json
|
202
|
+
- spec/hotels_pro/api/.gitkeep
|
203
|
+
- spec/hotels_pro/api/api_method_spec.rb
|
204
|
+
- spec/hotels_pro/api/api_params_spec.rb
|
205
|
+
- spec/hotels_pro/api/elements/pax_array_spec.rb
|
206
|
+
- spec/hotels_pro/api/methods/allocate_hotel_code_spec.rb
|
207
|
+
- spec/hotels_pro/api/methods/amend_hotel_booking_spec.rb
|
208
|
+
- spec/hotels_pro/api/methods/cancel_hotel_booking_spec.rb
|
209
|
+
- spec/hotels_pro/api/methods/get_available_hotel_spec.rb
|
210
|
+
- spec/hotels_pro/api/methods/get_balance_spec.rb
|
211
|
+
- spec/hotels_pro/api/methods/get_hotel_booking_status_spec.rb
|
212
|
+
- spec/hotels_pro/api/methods/get_hotel_cancellation_policy_spec.rb
|
213
|
+
- spec/hotels_pro/api/methods/make_hotel_booking_spec.rb
|
214
|
+
- spec/hotels_pro/query_spec.rb
|
215
|
+
- spec/hotels_pro/request_spec.rb
|
216
|
+
- spec/hotels_pro/response_spec.rb
|
217
|
+
- spec/hotels_pro/stubs/stub_spec.rb
|
218
|
+
- spec/hotels_pro/stubs_spec.rb
|
219
|
+
- spec/hotels_pro/underscorer_spec.rb
|
220
|
+
- spec/request_helper.rb
|
221
|
+
- spec/spec_helper.rb
|
222
|
+
has_rdoc:
|