tourico 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- tourico (0.0.2)
4
+ tourico (0.0.3)
5
5
  savon (~> 1.2.0)
6
6
 
7
7
  GEM
data/lib/tourico/api.rb CHANGED
@@ -9,6 +9,10 @@ module Tourico
9
9
  services(:search_hotels, args)
10
10
  end
11
11
 
12
+ def get_list_by_hotel(args)
13
+ services(:search_hotels_by_id, args)
14
+ end
15
+
12
16
  def get_hotel_details(args)
13
17
  services(:get_hotel_details_v3,args)
14
18
  end
@@ -52,7 +56,7 @@ module Tourico
52
56
 
53
57
  def services (action, args)
54
58
  reservations_services = [:get_cancellation_policies, :get_previous_RG,:get_cancellation_fee,:cancel_reservation]
55
- hotel_services = [:search_hotels,:get_hotel_details_v3,:book_hotel_v3, :check_availability_and_prices]
59
+ hotel_services = [:search_hotels,:search_hotels_by_id,:get_hotel_details_v3,:book_hotel_v3, :check_availability_and_prices]
56
60
 
57
61
  if reservations_services.include?(action)
58
62
  return HTTPService.make_request_reservation_service(action, args)
@@ -37,7 +37,6 @@ module Tourico
37
37
  end
38
38
  end
39
39
 
40
-
41
40
  def make_request_reservation_service(action, args, options = {})
42
41
 
43
42
  client = Savon::Client.new(API_RESERVATION_SERVICE_LINK)
@@ -1,3 +1,3 @@
1
1
  module Tourico
2
- VERSION = '0.0.2'
2
+ VERSION = '0.0.3'
3
3
  end
Binary file
@@ -2,13 +2,13 @@ require 'tourico'
2
2
 
3
3
  describe Tourico::Api do
4
4
 
5
- it 'search by hotels' do
5
+ it 'search by destination' do
6
6
  api = Tourico::Api.new
7
7
  args = {
8
8
  'hot:request' => {
9
9
  'hot1:Destination' => 'NYC',
10
- 'hot1:CheckIn' => '2013-08-23',
11
- 'hot1:CheckOut' => '2013-08-25',
10
+ 'hot1:CheckIn' => '2013-10-23',
11
+ 'hot1:CheckOut' => '2013-10-25',
12
12
  'hot1:RoomsInformation' => {
13
13
  'hot1:RoomInfo' => {
14
14
  'hot1:AdultNum' => '2',
@@ -23,6 +23,30 @@ describe Tourico::Api do
23
23
  api.get_list(args).should_not be_nil
24
24
  end
25
25
 
26
+ it 'search by hotel id' do
27
+ api = Tourico::Api.new
28
+ args = {
29
+ 'hot:request' => {
30
+ 'hot1:HotelIdsInfo' => {
31
+ 'hot1:HotelIdInfo' => '',
32
+ :attributes! => {'hot1:HotelIdInfo' => {'id' => '1314802'}},
33
+ },
34
+ 'hot1:CheckIn' => '2013-10-23',
35
+ 'hot1:CheckOut' => '2013-10-25',
36
+ 'hot1:RoomsInformation' => {
37
+ 'hot1:RoomInfo' => {
38
+ 'hot1:AdultNum' => '2',
39
+ 'hot1:ChildNum' => '0',
40
+ }
41
+ },
42
+ 'hot1:MaxPrice' => '0',
43
+ 'hot1:StarLevel' => '0',
44
+ 'hot1:AvailableOnly' => 'true'
45
+ }
46
+ }
47
+ api.get_list_by_hotel(args).should_not be_nil
48
+ end
49
+
26
50
  it 'get hotel details v3' do
27
51
  api = Tourico::Api.new
28
52
  args = {
data/tourico.gemspec CHANGED
@@ -10,7 +10,7 @@ Gem::Specification.new do |gem|
10
10
  gem.email = ["vitali.m86@gmail.com"]
11
11
  gem.description = %q{Tourico gem is a ruby wrapper for Tourico API Affiliate Network}
12
12
  gem.summary = %q{Tourico gem is a ruby wrapper for Tourico API Affiliate Network}
13
- gem.homepage = "http://doc.touricoholidays.com"
13
+ gem.homepage = "https://github.com/vitalim/Tourico"
14
14
  gem.license = "MIT"
15
15
 
16
16
  gem.files = `git ls-files`.split($/)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tourico
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-09-02 00:00:00.000000000 Z
12
+ date: 2013-09-29 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake
@@ -78,11 +78,12 @@ files:
78
78
  - lib/tourico/http_service.rb
79
79
  - lib/tourico/version.rb
80
80
  - pkg/tourico-0.0.1.gem
81
+ - pkg/tourico-0.0.3.gem
81
82
  - spec/models/api_spec.rb
82
83
  - spec/spec_helper.rb
83
84
  - spec/tourico_spec.rb
84
85
  - tourico.gemspec
85
- homepage: http://doc.touricoholidays.com
86
+ homepage: https://github.com/vitalim/Tourico
86
87
  licenses:
87
88
  - MIT
88
89
  post_install_message:
@@ -95,12 +96,18 @@ required_ruby_version: !ruby/object:Gem::Requirement
95
96
  - - ! '>='
96
97
  - !ruby/object:Gem::Version
97
98
  version: '0'
99
+ segments:
100
+ - 0
101
+ hash: -3025441895499345331
98
102
  required_rubygems_version: !ruby/object:Gem::Requirement
99
103
  none: false
100
104
  requirements:
101
105
  - - ! '>='
102
106
  - !ruby/object:Gem::Version
103
107
  version: '0'
108
+ segments:
109
+ - 0
110
+ hash: -3025441895499345331
104
111
  requirements: []
105
112
  rubyforge_project:
106
113
  rubygems_version: 1.8.24