chiketto 0.4.1 → 0.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/chiketto/event.rb +16 -2
- data/lib/chiketto/version.rb +1 -1
- data/test/event_test.rb +1 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f003de4b80d524222a005ef12e9b7cfa1dd079c3
|
4
|
+
data.tar.gz: fb4c106c1721c81f701cb31d1e944bce1283c1e9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 43508152781d540edcee40a2b4a04595b1e2986901dd92180911b93631916093236751e5df96e8e6c0e494ab781ea11d20561a7646d083641999e298ce3c3913
|
7
|
+
data.tar.gz: b3e3c6356b89f30a451ef1b83568806c6a0c53a6eba4dd2de299a19a54facc0f4132722086ee77dea24ae22d46719651ae9323a7bd326af9d63bdf9f1aedd612
|
data/lib/chiketto/event.rb
CHANGED
@@ -35,8 +35,8 @@ module Chiketto
|
|
35
35
|
end
|
36
36
|
|
37
37
|
def attendees(params = {})
|
38
|
-
attendees = Event.
|
39
|
-
attendees
|
38
|
+
attendees = Event.paginated_attendees @id, params
|
39
|
+
attendees.map { |att| Attendee.new att }
|
40
40
|
end
|
41
41
|
|
42
42
|
def organizer
|
@@ -67,5 +67,19 @@ module Chiketto
|
|
67
67
|
def self.find_attendees(id, params)
|
68
68
|
get "events/#{id}/attendees", params
|
69
69
|
end
|
70
|
+
|
71
|
+
def self.paginated_attendees(id, params, page = 1, attendees = [])
|
72
|
+
response = Event.find_attendees id, params.merge(page: page.to_s)
|
73
|
+
attendees.concat response['attendees']
|
74
|
+
if should_paginate(response['pagination'])
|
75
|
+
Event.paginated_attendees id, params, page + 1, attendees
|
76
|
+
else
|
77
|
+
attendees
|
78
|
+
end
|
79
|
+
end
|
80
|
+
|
81
|
+
def self.should_paginate(pagination)
|
82
|
+
pagination['page_count'] > pagination['page_number']
|
83
|
+
end
|
70
84
|
end
|
71
85
|
end
|
data/lib/chiketto/version.rb
CHANGED
data/test/event_test.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chiketto
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Radford
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-10-
|
11
|
+
date: 2014-10-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|