access 1.0.8 → 1.1.0

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: 42607fb01b18f1491d0d2a9a28d594c7619c0f51
4
- data.tar.gz: 60e3c119d01d2f2e19499d23e7d381a55a838e0f
3
+ metadata.gz: 25f8be3a87de2c36b8f409fa33b74c5253e1f1f5
4
+ data.tar.gz: fd7dbfc14b4b73237998469d4a4655ee4cea0685
5
5
  SHA512:
6
- metadata.gz: 2a434772a3cfd578221f04bde70e4768a1538d30bd074b71335832598cab01728df9394dc6e9f9815b343f5cea7fed2f4ada5c947dc10dbec558b0d489faae0a
7
- data.tar.gz: 247d8ffb9303170623716961a3269521681b0ad6f255fd5f2c06e2b0cdf52c8d009bdbb65861c8e227d80f7f8a15e35158f60623fd36e5acf2a93317597943d1
6
+ metadata.gz: 306c7cf380a584de635199746e03a0dc8143c26edfe8d8c1684bd1389a40c8c4de8291f2c31ad38cc2c560a8b9d85b8b2664d0ff9b5a1c5b1a499acaa7d2c634
7
+ data.tar.gz: 4565e37972e6f0091518608bb6855e4fb39080e2f988d4fe9fedbd3465925a04807e885639aa227c128ffcadda11199950294788792c4a10bfcb276006b3c820
@@ -13,7 +13,9 @@ require "access/location"
13
13
  require "access/category"
14
14
  require "access/autocomplete"
15
15
  require "access/report"
16
+ require "access/oauth_application"
16
17
  require "access/token"
18
+ require "access/verify"
17
19
  require "access/redeem"
18
20
  # require "access/member"
19
21
 
@@ -1,7 +1,7 @@
1
1
  module Access
2
2
  class Api < Request
3
3
 
4
- ###offer
4
+ # Categories
5
5
  def search_categories(options = {})
6
6
  get("/categories", "offer", options)
7
7
  end
@@ -10,6 +10,8 @@ module Access
10
10
  get("/categories/#{category_id}", "offer", options)
11
11
  end
12
12
 
13
+
14
+ # Offers
13
15
  def search_offers(options={})
14
16
  get("/offers", "offer", options)
15
17
  end
@@ -18,6 +20,8 @@ module Access
18
20
  get("/offers/#{offer_id}", "offer", options)
19
21
  end
20
22
 
23
+
24
+ # Locations
21
25
  def search_locations(options={})
22
26
  get("/locations", "offer", options)
23
27
  end
@@ -26,6 +30,8 @@ module Access
26
30
  get("/locations/#{location_id}", "offer", options)
27
31
  end
28
32
 
33
+
34
+ # Stores
29
35
  def search_stores(options={})
30
36
  get("/stores", "offer", options)
31
37
  end
@@ -34,31 +40,82 @@ module Access
34
40
  get("/stores/#{store_id}", "offer", options)
35
41
  end
36
42
 
37
- ### auto complete
43
+
44
+ # Autocomplete
38
45
  def autocomplete(options = {})
39
46
  get("/autocomplete", "offer", options)
40
47
  end
41
48
 
42
- ###token
43
- def verify(options = {})
44
- get("/verify", "token", options)
49
+
50
+ # Oauth Applications
51
+ def search_oauth_applications(options = {})
52
+ get('/oauth_applications', 'token', options)
53
+ end
54
+
55
+ def find_oauth_application(application_id, options = {})
56
+ get("/oauth_applications/#{application_id}", 'token', options)
57
+ end
58
+
59
+ def search_oauth_application_tokens(application_id, options = {})
60
+ get("/oauth_applications/#{application_id}/access_tokens", 'token', options)
61
+ end
62
+
63
+ def find_oauth_application_token(application_id, token_id, options = {})
64
+ get("/oauth_applications/#{application_id}/access_tokens/#{token_id}", 'token', options)
65
+ end
66
+
67
+ def create_oauth_application_token(application_id, options = {})
68
+ create("/oauth_applications/#{application_id}/access_tokens", 'token', options)
69
+ end
70
+
71
+ def create_oauth_application(options = {})
72
+ create("/oauth_applications", 'token', options)
45
73
  end
46
74
 
47
- def verify_other(token, options = {})
48
- get("/verify/#{token}", "token", options)
75
+ def update_oauth_application(application_id, options = {})
76
+ put("/oauth_applications/#{application_id}", 'token', options)
77
+ end
78
+
79
+ def delete_oauth_application(application_id, options = {})
80
+ delete("/oauth_applications/#{application_id}", 'token', options)
81
+ end
82
+
83
+
84
+ # Access Tokens
85
+ def search_tokens(options = {})
86
+ get('/tokens', 'token', options)
87
+ end
88
+
89
+ def find_token(token, options = {}) # new verify_other
90
+ get("/tokens/#{token}", "token", options)
91
+ end
92
+
93
+
94
+ # Verify
95
+ def verify_token(options = {})
96
+ get('/token', 'verify', options)
49
97
  end
50
98
 
51
99
  def verify_filter(options = {})
52
- get("/filter", "token", options)
100
+ get('/filter', 'verify', options)
53
101
  end
54
102
 
55
- ###redeem
103
+ # def verify(options = {})
104
+ # get("/verify", "token", options)
105
+ # end
106
+
107
+ # def verify_filter(options = {})
108
+ # get("/filter", "token", options)
109
+ # end
110
+
111
+
112
+ # Redeem
56
113
  def redeem_offer(offer_key, redeem_type = nil, options = {})
57
114
  get("/redeem/#{offer_key}/#{redeem_type}", "redeem", options)
58
115
  end
59
116
 
60
- ###report
61
117
 
118
+ # Report
62
119
  def all_usage(options = {})
63
120
  get("/all_usage", "report", options)
64
121
  end
@@ -71,7 +128,8 @@ module Access
71
128
  get("/usage/#{token}", "report", options)
72
129
  end
73
130
 
74
- ###member
131
+
132
+ # Member
75
133
 
76
134
  end
77
135
  end
@@ -1,5 +1,6 @@
1
1
  module Access
2
2
  class Autocomplete
3
+
3
4
  def self.search(options = {})
4
5
  Access::Api.new.autocomplete options
5
6
  end
@@ -19,5 +20,6 @@ module Access
19
20
  def self.search_locations(options = {})
20
21
  Access::Api.new.autocomplete options.merge(resources: 'locations')
21
22
  end
23
+
22
24
  end
23
25
  end
@@ -1,5 +1,6 @@
1
1
  module Access
2
2
  class Category
3
+
3
4
  def self.search(options = {})
4
5
  Access::Api.new.search_categories options
5
6
  end
@@ -7,5 +8,6 @@ module Access
7
8
  def self.find(key, options = {})
8
9
  Access::Api.new.find_category key, options
9
10
  end
11
+
10
12
  end
11
13
  end
@@ -31,5 +31,6 @@ module Access
31
31
  self.hashify = false
32
32
  end
33
33
  end
34
+
34
35
  end
35
36
 
@@ -1,8 +1,10 @@
1
1
  module Access
2
2
  module Error
3
+
3
4
  class AuthenticationError < StandardError; end
4
5
  class NoAccessToken < AuthenticationError; end
5
6
  class InvalidResponseFormat < TypeError; end
7
+
6
8
  end
7
9
  end
8
10
 
@@ -1,5 +1,6 @@
1
1
  module Access
2
2
  class Location
3
+
3
4
  def self.search(options = {})
4
5
  Access::Api.new.search_locations options
5
6
  end
@@ -7,5 +8,6 @@ module Access
7
8
  def self.find(key, options = {})
8
9
  Access::Api.new.find_location key, options
9
10
  end
11
+
10
12
  end
11
13
  end
@@ -0,0 +1,37 @@
1
+ module Access
2
+ class OauthApplication
3
+
4
+ def self.search(options = {})
5
+ Access::Api.new.search_oauth_applications options
6
+ end
7
+
8
+ def self.find(application_id, options = {})
9
+ Access::Api.new.find_oauth_application application_id, options
10
+ end
11
+
12
+ def self.search_tokens(application_id, options = {})
13
+ Access::Api.new.search_oauth_application_tokens application_id, options
14
+ end
15
+
16
+ def self.find_token(application_id, token_id, options = {})
17
+ Access::Api.new.find_oauth_application_token application_id, token_id, options
18
+ end
19
+
20
+ def self.create_token(application_id, options = {})
21
+ Access::Api.new.create_oauth_application_token application_id, options
22
+ end
23
+
24
+ def self.create(options = {})
25
+ Access::Api.new.create_oauth_application options
26
+ end
27
+
28
+ def self.update(application_id, options = {})
29
+ Access::Api.new.update_oauth_application application_id, options
30
+ end
31
+
32
+ def self.delete(application_id, options = {})
33
+ Access::Api.new.delete_oauth_application application_id, options
34
+ end
35
+
36
+ end
37
+ end
@@ -26,5 +26,6 @@ module Access
26
26
  def self.find(key, options = {})
27
27
  Access::Api.new.find_offer key, options
28
28
  end
29
+
29
30
  end
30
31
  end
@@ -1,7 +1,9 @@
1
1
  module Access
2
2
  class Redeem
3
+
3
4
  def self.redeem_offer(key, redeem_type = nil, options = {})
4
5
  Access::Api.new.redeem_offer key, redeem_type, options
5
6
  end
7
+
6
8
  end
7
9
  end
@@ -12,5 +12,6 @@ module Access
12
12
  def self.usage_other(key, options = {})
13
13
  Access::Api.new.usage_other key, options
14
14
  end
15
+
15
16
  end
16
17
  end
@@ -1,5 +1,6 @@
1
1
  module Access
2
2
  class Store
3
+
3
4
  def self.search(options = {})
4
5
  Access::Api.new.search_stores options
5
6
  end
@@ -7,5 +8,6 @@ module Access
7
8
  def self.find(key, options = {})
8
9
  Access::Api.new.find_store key, options
9
10
  end
11
+
10
12
  end
11
13
  end
@@ -1,15 +1,13 @@
1
1
  module Access
2
2
  class Token
3
- def self.verify(options = {})
4
- Access::Api.new.verify options
5
- end
6
3
 
7
- def self.verify_other(token, options = {})
8
- Access::Api.new.verify_other token, options
4
+ def self.search(options = {})
5
+ Access::Api.new.search_tokens options
9
6
  end
10
7
 
11
- def self.verify_filter(options = {})
12
- Access::Api.new.verify_filter options
8
+ def self.find(token, options = {})
9
+ Access::Api.new.find_token token, options
13
10
  end
11
+
14
12
  end
15
13
  end
@@ -0,0 +1,13 @@
1
+ module Access
2
+ class Verify
3
+
4
+ def self.token(options = {})
5
+ Access::Api.new.verify_token options
6
+ end
7
+
8
+ def self.filter(options = {})
9
+ Access::Api.new.verify_filter options
10
+ end
11
+
12
+ end
13
+ end
@@ -1,4 +1,4 @@
1
1
  module Access
2
- VERSION = "1.0.8"
2
+ VERSION = "1.1.0"
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: 1.0.8
4
+ version: 1.1.0
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: 2015-04-29 00:00:00.000000000 Z
13
+ date: 2015-05-04 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: bundler
@@ -147,12 +147,14 @@ files:
147
147
  - lib/access/error.rb
148
148
  - lib/access/location.rb
149
149
  - lib/access/member.rb
150
+ - lib/access/oauth_application.rb
150
151
  - lib/access/offer.rb
151
152
  - lib/access/redeem.rb
152
153
  - lib/access/report.rb
153
154
  - lib/access/request.rb
154
155
  - lib/access/store.rb
155
156
  - lib/access/token.rb
157
+ - lib/access/verify.rb
156
158
  - lib/access/version.rb
157
159
  - test/offers/offer_test.rb
158
160
  - test/test_helper.rb