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 +4 -4
- data/Gemfile.lock +4 -1
- data/lib/access.rb +1 -0
- data/lib/access/api.rb +13 -0
- data/lib/access/hotel.rb +24 -0
- data/lib/access/response.rb +9 -0
- data/lib/access/spot.rb +1 -0
- data/lib/access/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6363f359072bfc4474ab11e29041a23edfa0e845
|
4
|
+
data.tar.gz: 28aefee60d0da7c8319ba41523f4c2b42f811db0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f4f3bc8cefd862de06c8e5e9145c549bedd4958dc4c13ad7fc68bca3a438d14604315c6dc1f4e68ea8bf3b48323327f42377c7a835cd546e7e6d3067b4d8d6ec
|
7
|
+
data.tar.gz: 0b81ec0c3785143bfcb369a24851219bd88fb84538d156c80f1eee8ec79910b0d4cedbf2ff67d24f9866fa80b268ebdf47307793bfa56e9964c33deaacbd0c37
|
data/Gemfile.lock
CHANGED
data/lib/access.rb
CHANGED
data/lib/access/api.rb
CHANGED
@@ -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|
|
data/lib/access/hotel.rb
ADDED
@@ -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
|
data/lib/access/response.rb
CHANGED
@@ -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
|
data/lib/access/spot.rb
CHANGED
data/lib/access/version.rb
CHANGED
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.
|
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-
|
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.
|
410
|
+
rubygems_version: 2.4.8
|
410
411
|
signing_key:
|
411
412
|
specification_version: 4
|
412
413
|
summary: Ruby wrapper for Access API
|