access 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +63 -24
- data/lib/access/api.rb +6 -0
- data/lib/access/filter.rb +7 -0
- data/lib/access/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b6cc51d6e304ed05d48f23fec9984b1c60b01474
|
4
|
+
data.tar.gz: 16c0985b95ba5d94b49a6b227a8ec34de5e37308
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0015ee31ae23ee73648f18042c79709a1de33edb0b9a98c2cb4d778cc3b2e9daf1944e24cfdf7cdde272d0ea2625ab524b8b65ca4929fffa5a45256efb02d028
|
7
|
+
data.tar.gz: f6497472d4e4939d4a76ad1343bb07dff5408eaa70c3a414808e7f4e4e54fa6d86b9447c5e04e49818ac3e10d0168cbd06cb68aa00ed6e85b361962963fc4ea5
|
data/README.md
CHANGED
@@ -24,65 +24,104 @@ Or install it yourself as:
|
|
24
24
|
|
25
25
|
You can configure the following options:
|
26
26
|
|
27
|
-
- `access_token` Required
|
28
|
-
- `format
|
29
|
-
- `api_environment
|
30
|
-
- `api_version`
|
31
|
-
- `hashify` Returns the results all using Hashie::Mash if
|
27
|
+
- `access_token` **Required**
|
28
|
+
- `format`: Set as `'json'` or `'xml'`. Default is `'json'`
|
29
|
+
- `api_environment`: Set as `'staging'` or `'production'`. Default is `'staging'`
|
30
|
+
- `api_version`: `'v1'` is default.
|
31
|
+
- `hashify` Returns the results all using Hashie::Mash if `'true'`, Default is `'false'`
|
32
32
|
|
33
|
-
|
33
|
+
#### Config via Environment Variables
|
34
|
+
|
35
|
+
You can set config settings by creating environment variables called:
|
34
36
|
|
35
37
|
`ENV['ACCESS_TOKEN']`, `ENV['ACCESS_FORMAT']`, `ENV['ACCESS_ENVIRONMENT']`, `ENV['ACCESS_VERSION']`, `ENV['ACCESS_HASHIFY']`
|
36
38
|
|
37
|
-
|
39
|
+
#### Config via Initializer
|
38
40
|
|
39
|
-
|
41
|
+
You can also create an initializer file to set up a config
|
42
|
+
|
43
|
+
```ruby
|
40
44
|
Access.configure do |config|
|
41
45
|
config.access_token = ENV['ACCESS_TOKEN']
|
42
|
-
config.hashify =
|
46
|
+
config.hashify = 'true'
|
43
47
|
end
|
44
48
|
```
|
45
49
|
|
46
50
|
You can also set them one at a time
|
47
51
|
|
48
|
-
`Access.config.format = 'xml`
|
52
|
+
`Access.config.format = 'xml'`
|
49
53
|
|
50
54
|
###Making Calls
|
51
55
|
|
52
56
|
####Offer
|
53
57
|
|
54
|
-
|
55
|
-
|
58
|
+
```ruby
|
59
|
+
Access::Offer.search options
|
60
|
+
```
|
61
|
+
|
62
|
+
```ruby
|
63
|
+
Access::Offer.find **offer_key** options, member_key: **your-member-key**
|
64
|
+
```
|
56
65
|
|
57
66
|
####Store
|
58
67
|
|
59
|
-
|
60
|
-
|
68
|
+
```ruby
|
69
|
+
Access::Store.search options
|
70
|
+
```
|
71
|
+
|
72
|
+
```ruby
|
73
|
+
Access::Store.find store_key options
|
74
|
+
```
|
61
75
|
|
62
76
|
####Location
|
63
77
|
|
64
|
-
|
65
|
-
|
78
|
+
```ruby
|
79
|
+
Access::Location.search options
|
80
|
+
```
|
81
|
+
|
82
|
+
```ruby
|
83
|
+
Access::Location.find location_key options
|
84
|
+
```
|
66
85
|
|
67
86
|
####Category
|
68
87
|
|
69
|
-
|
70
|
-
|
88
|
+
```ruby
|
89
|
+
Access::Category.search options
|
90
|
+
```
|
91
|
+
|
92
|
+
```ruby
|
93
|
+
Access::Category.find key options
|
94
|
+
```
|
71
95
|
|
72
96
|
####Report
|
73
97
|
|
74
|
-
|
75
|
-
|
98
|
+
```ruby
|
99
|
+
Access::Report.usage options
|
100
|
+
```
|
101
|
+
|
102
|
+
```ruby
|
103
|
+
Access::Report.usage token options
|
104
|
+
```
|
76
105
|
|
77
106
|
####Token
|
78
107
|
|
79
|
-
|
80
|
-
|
108
|
+
```ruby
|
109
|
+
Access::Token.verify options
|
110
|
+
```
|
111
|
+
|
112
|
+
```ruby
|
113
|
+
Access::Token.verify_other token options
|
114
|
+
```
|
81
115
|
|
82
116
|
####Redeem
|
83
117
|
|
84
|
-
|
85
|
-
|
118
|
+
```ruby
|
119
|
+
Access::Redeem.redeem_offer key nil options` *member_key required
|
120
|
+
```
|
121
|
+
|
122
|
+
```ruby
|
123
|
+
Access::Redeem.redeem_offer key redeem_type options` *member_key required
|
124
|
+
```
|
86
125
|
|
87
126
|
####Member
|
88
127
|
|
data/lib/access/api.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: 1.0.
|
4
|
+
version: 1.0.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: 2015-01-
|
13
|
+
date: 2015-01-28 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: bundler
|
@@ -143,6 +143,7 @@ files:
|
|
143
143
|
- lib/access/api.rb
|
144
144
|
- lib/access/category.rb
|
145
145
|
- lib/access/config.rb
|
146
|
+
- lib/access/filter.rb
|
146
147
|
- lib/access/location.rb
|
147
148
|
- lib/access/member.rb
|
148
149
|
- lib/access/offer.rb
|