planvine 0.0.13 → 0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/planvine/builders/categories_builder.rb +3 -6
- data/lib/planvine/planvine_api.rb +2 -16
- data/lib/planvine/version.rb +1 -1
- 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: 0c8f3b8a1728cd516340852d1c44a2bdc184e91f
|
4
|
+
data.tar.gz: 58689f095df193ae112c1e4d08ea94c2e56cd994
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 81540f7f65c366296627c433aa3a9cfed1b27b170c20ea7b810c39d1d7467814d6d257283fc59a332bf6a644d8602a9739f3f00f9431a5278067c6c8e8cbf11d
|
7
|
+
data.tar.gz: 1456b66c05d771e7e2af5799c44d172672acc473b4fe56c8c187717036913d99cfe6ca70aa18a07cc4d9efcab7c4385556f06e9238eb4528bdcdbcb43e5efcae
|
@@ -18,12 +18,9 @@ module Planvine
|
|
18
18
|
|
19
19
|
def events
|
20
20
|
return [] if api.category_events(id).nil?
|
21
|
-
api.category_events(id).map do |
|
22
|
-
|
23
|
-
|
24
|
-
EventsBuilder.build(full_event)
|
25
|
-
end
|
26
|
-
end.flatten
|
21
|
+
api.category_events(id).map do |event|
|
22
|
+
EventsBuilder.build(event)
|
23
|
+
end
|
27
24
|
end
|
28
25
|
|
29
26
|
def api
|
@@ -21,22 +21,8 @@ module Planvine
|
|
21
21
|
end
|
22
22
|
end
|
23
23
|
|
24
|
-
def category_events(id)
|
25
|
-
|
26
|
-
number_of_pages = self.class.get("/category/#{id}/events?api_key=#{@api_key}")["_metadata"]["total_pages"]
|
27
|
-
rescue
|
28
|
-
number_of_pages = 1
|
29
|
-
end
|
30
|
-
events = [self.class.get("/category/#{id}/events?api_key=#{@api_key}")["data"]]
|
31
|
-
return events if number_of_pages == 1
|
32
|
-
|
33
|
-
self.class.get("/category/#{id}/events?api_key=#{@api_key}")["_metadata"]["total_pages"].times do |i|
|
34
|
-
next if (i+1) == 1
|
35
|
-
page = self.class.get("/category/#{id}/events?api_key=#{@api_key}&page=#{i + 1}")["data"]
|
36
|
-
|
37
|
-
events << page
|
38
|
-
end
|
39
|
-
events
|
24
|
+
def category_events(id, results_count=100)
|
25
|
+
self.class.get("/category/#{id}/events?api_key=#{@api_key}&results_per_page=#{results_count}")["data"]
|
40
26
|
end
|
41
27
|
|
42
28
|
def event(id)
|
data/lib/planvine/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: planvine
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: '0.1'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Richard Patching
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-05-
|
11
|
+
date: 2013-05-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|