access 2.1.1 → 2.1.2

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: bcfee6fba949b6f690c46a643dd6549bd14ffb0d
4
- data.tar.gz: 86822828b5bd2863bd7c77fc17730e155ee2548f
3
+ metadata.gz: 6363f359072bfc4474ab11e29041a23edfa0e845
4
+ data.tar.gz: 28aefee60d0da7c8319ba41523f4c2b42f811db0
5
5
  SHA512:
6
- metadata.gz: 4b102099757e57fcfa7876e4b319d9e0b50f17ea6c4bd679a24b396a577bbdd56eb382b7a072635f637f6583ad6fe76058e852ac845e02a9029108197c5cdd3a
7
- data.tar.gz: e7cc0f07e418b635773ae11368b4da798ef65f106f795c13bde6f98e2ac97f59c249477678c083e85c347ff1f51007bdbe7827e143e65f642d2f7a289c71e9c7
6
+ metadata.gz: f4f3bc8cefd862de06c8e5e9145c549bedd4958dc4c13ad7fc68bca3a438d14604315c6dc1f4e68ea8bf3b48323327f42377c7a835cd546e7e6d3067b4d8d6ec
7
+ data.tar.gz: 0b81ec0c3785143bfcb369a24851219bd88fb84538d156c80f1eee8ec79910b0d4cedbf2ff67d24f9866fa80b268ebdf47307793bfa56e9964c33deaacbd0c37
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- access (2.1.1)
4
+ access (2.1.2)
5
5
  hashie (~> 3.3.1)
6
6
  httparty (~> 0.13.3)
7
7
 
@@ -111,3 +111,6 @@ DEPENDENCIES
111
111
  simplecov
112
112
  vcr
113
113
  webmock
114
+
115
+ BUNDLED WITH
116
+ 1.11.2
@@ -39,6 +39,7 @@ require "access/user"
39
39
  require "access/verify"
40
40
  require "access/version"
41
41
  require "access/shopping_cart"
42
+ require "access/hotel"
42
43
 
43
44
  module Access
44
45
 
@@ -40,6 +40,19 @@ module Access
40
40
  end
41
41
  end
42
42
 
43
+ #Hotels
44
+ def search_hotels(options = {})
45
+ request.get("/hotels", "hotel", options) do |response|
46
+ HotelResponse.new(response)
47
+ end
48
+ end
49
+
50
+ def find_hotel(hotel_key, options = {})
51
+ request.get("/hotels/#{hotel_key}", "hotel", options) do |response|
52
+ HotelResponse.new(response)
53
+ end
54
+ end
55
+
43
56
  # Locations
44
57
  def search_locations(options = {})
45
58
  request.get("/locations", "offer", options) do |response|
@@ -0,0 +1,24 @@
1
+ module Access
2
+ class Hotel
3
+ include Access::MuchMeta
4
+
5
+ def initialize(values)
6
+ @used_fields = []
7
+ set_up_methods(values)
8
+ set_values(values)
9
+ end
10
+
11
+ def self.search(options = {})
12
+ Access::Api.new.search_hotels options
13
+ end
14
+
15
+ def self.find(hotel_key, options = {})
16
+ Access::Api.new.find_hotel hotel_key, options
17
+ end
18
+
19
+ def self.process_batch(chunk)
20
+ chunk.map { |hotel| new(hotel) }
21
+ end
22
+
23
+ end
24
+ end
@@ -21,6 +21,8 @@ module Access
21
21
  attr_reader :total_cart_count
22
22
  #amt
23
23
  attr_reader :data
24
+ #hotel
25
+ attr_reader :hotels
24
26
 
25
27
  def initialize(response)
26
28
  @response = response # Setting this temporarily so i can have a working member reg call, since it doesn't follow the resource [] best practices
@@ -69,6 +71,13 @@ module Access
69
71
  end
70
72
  end
71
73
 
74
+ class HotelResponse < Response
75
+ def process_data
76
+ (@hotels = []; create_error) if @message
77
+ @hotels = Access::Hotel.process_batch(@hotels) if @hotels
78
+ end
79
+ end
80
+
72
81
  class StoreResponse < Response
73
82
  def process_data
74
83
  (@stores = []; create_error) if @message
@@ -34,5 +34,6 @@ module Access
34
34
  def campaign
35
35
  @campaign_resource
36
36
  end
37
+
37
38
  end
38
39
  end
@@ -1,4 +1,4 @@
1
1
  module Access
2
- VERSION = "2.1.1"
2
+ VERSION = "2.1.2"
3
3
  end
4
4
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: access
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.1
4
+ version: 2.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Eggett
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2017-02-02 00:00:00.000000000 Z
13
+ date: 2017-02-09 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: bundler
@@ -247,6 +247,7 @@ files:
247
247
  - lib/access/favorite.rb
248
248
  - lib/access/filter.rb
249
249
  - lib/access/geolocation.rb
250
+ - lib/access/hotel.rb
250
251
  - lib/access/info.rb
251
252
  - lib/access/link.rb
252
253
  - lib/access/location.rb
@@ -406,7 +407,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
406
407
  version: '0'
407
408
  requirements: []
408
409
  rubyforge_project:
409
- rubygems_version: 2.4.5
410
+ rubygems_version: 2.4.8
410
411
  signing_key:
411
412
  specification_version: 4
412
413
  summary: Ruby wrapper for Access API