eventbrite_sdk 3.3.1 → 3.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +10 -0
- data/lib/eventbrite_sdk/resource_list.rb +18 -10
- data/lib/eventbrite_sdk/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2c1e67123425f40c0f27d858eb440c95f5a19d2d
|
4
|
+
data.tar.gz: a7e48208c305d9bc8e89525c73097114bd6821f5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c40cc4297d6aa7c915ff70c5580b4c32f2193191eaec752e69bef68d5912d9156bf3d8187ae5fcbf7cc9c5f5c1e0b592b09c939b9c7813f83cbba48db1538e25
|
7
|
+
data.tar.gz: 8d1b496743e38f269e3c8cd23b843ac47c185b7d825294c810ec5937ad22bb20f67fcade02a4efa4b948c31d717813ea1bb28aac6bb862104322e70aa4b38ac9
|
data/README.md
CHANGED
@@ -91,6 +91,16 @@ events = user.owned_events.page(1) => events = user.owned_events
|
|
91
91
|
events.first => events[0]
|
92
92
|
events.last => events[-1]
|
93
93
|
|
94
|
+
# endpoints that support continuations: will be inferred from the current payload
|
95
|
+
# you can tell if a paginated result set supports continuations by checking for a non-nil #continuation
|
96
|
+
|
97
|
+
example.continuation #=> "dGhpcyBpcyBwYWdlIDE"
|
98
|
+
|
99
|
+
# you can continue until the example returns nil, which means there are no more items
|
100
|
+
example.continue
|
101
|
+
|
102
|
+
# you can also provide a token if you choose to do so
|
103
|
+
example.continue(continuation_token: 'my_token')
|
94
104
|
```
|
95
105
|
# Construct endpoint paths:
|
96
106
|
|
@@ -24,6 +24,17 @@ module EventbriteSDK
|
|
24
24
|
other.concat(to_ary)
|
25
25
|
end
|
26
26
|
|
27
|
+
def continue(continuation_token: nil, api_token: nil)
|
28
|
+
continuation_token ||= continuation
|
29
|
+
|
30
|
+
return unless continuation_token || has_more_items
|
31
|
+
|
32
|
+
retrieve(
|
33
|
+
api_token: api_token,
|
34
|
+
query: {continuation: continuation_token}
|
35
|
+
)
|
36
|
+
end
|
37
|
+
|
27
38
|
def retrieve(query: {}, api_token: nil)
|
28
39
|
@query.merge!(query)
|
29
40
|
load_response(api_token)
|
@@ -32,21 +43,22 @@ module EventbriteSDK
|
|
32
43
|
end
|
33
44
|
|
34
45
|
def page(num, api_token: nil)
|
35
|
-
|
36
|
-
|
37
|
-
|
46
|
+
retrieve(
|
47
|
+
api_token: api_token,
|
48
|
+
query: { page: num },
|
49
|
+
)
|
38
50
|
end
|
39
51
|
|
40
52
|
def next_page(api_token: nil)
|
41
53
|
return if page_number >= (page_count || 1)
|
42
54
|
|
43
|
-
page(
|
55
|
+
page(page_number + 1, api_token: api_token)
|
44
56
|
end
|
45
57
|
|
46
58
|
def prev_page(api_token: nil)
|
47
59
|
return if page_number <= 1
|
48
60
|
|
49
|
-
page(
|
61
|
+
page(page_number - 1, api_token: api_token)
|
50
62
|
end
|
51
63
|
|
52
64
|
%w[
|
@@ -93,11 +105,7 @@ module EventbriteSDK
|
|
93
105
|
end
|
94
106
|
|
95
107
|
def load_response(api_token)
|
96
|
-
response = request.get(
|
97
|
-
url: url_base,
|
98
|
-
query: { page: page_number }.merge(query),
|
99
|
-
api_token: api_token
|
100
|
-
)
|
108
|
+
response = request.get(api_token: api_token, query: query.dup, url: url_base)
|
101
109
|
|
102
110
|
@objects = (response[key.to_s] || []).map { |raw| object_class.new(raw) }
|
103
111
|
@pagination = response['pagination']
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: eventbrite_sdk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vinnie Franco
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2018-
|
13
|
+
date: 2018-11-01 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rest-client
|
@@ -167,7 +167,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
167
167
|
version: '0'
|
168
168
|
requirements: []
|
169
169
|
rubyforge_project:
|
170
|
-
rubygems_version: 2.
|
170
|
+
rubygems_version: 2.6.14
|
171
171
|
signing_key:
|
172
172
|
specification_version: 4
|
173
173
|
summary: Official Eventbrite SDK for the v3 API
|