planvine 0.0.8 → 0.0.9
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 05ccc8202243a3cfb0eac6d2a12eac0d0faf9431
|
4
|
+
data.tar.gz: 64fa9de473cb05f2ae7b7f669c6e304a07d7a1b6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9c31db93c0380a8fd946bfe2d2bd9b70f9f67d3a0a9602d0129ee6fecb7008d2f34bf332e613464dc89d87b9e260adecfd57af2a0064e63b8049e68408364692
|
7
|
+
data.tar.gz: fb94b7c7048f934906329963473dd02c34f82ef5e77afb579e4a73095366574b7b188c677325aa936d2470b039b3353e2bf5d11982a01b9625622debb94c2151
|
@@ -1,17 +1,20 @@
|
|
1
1
|
module Planvine
|
2
2
|
class EventsBuilder
|
3
3
|
def self.build(event)
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
4
|
+
begin
|
5
|
+
Event.new(
|
6
|
+
:end_date => event["end_date"],
|
7
|
+
:title => event["title"],
|
8
|
+
:url => event["url"],
|
9
|
+
:photo => (event["photo"].nil? ? "" : event["photo"]["url"]),
|
10
|
+
:start_date => event["start_date"],
|
11
|
+
:description => event["description"],
|
12
|
+
:source => event["source"],
|
13
|
+
:venue => Venue.new(event["venue"]),
|
14
|
+
:id => event["id"]
|
15
|
+
)
|
16
|
+
rescue
|
17
|
+
end
|
15
18
|
end
|
16
19
|
end
|
17
20
|
end
|
@@ -22,7 +22,15 @@ module Planvine
|
|
22
22
|
end
|
23
23
|
|
24
24
|
def category_events(id)
|
25
|
-
self.class.get("/category/#{id}/events?api_key=#{@api_key}")["
|
25
|
+
number_of_pages = self.class.get("/category/#{id}/events?api_key=#{@api_key}")["_metadata"]["total_pages"]
|
26
|
+
events = [self.class.get("/category/#{id}/events?api_key=#{@api_key}")["data"]]
|
27
|
+
return events if number_of_pages == 1
|
28
|
+
|
29
|
+
self.class.get("/category/#{id}/events?api_key=#{@api_key}")["_metadata"]["total_pages"].times do |i|
|
30
|
+
next if (i+1) == 1
|
31
|
+
events << self.class.get("/category/#{id}/events?api_key=#{@api_key}&page=#{i + 1}")["data"]
|
32
|
+
end
|
33
|
+
events.flatten
|
26
34
|
end
|
27
35
|
|
28
36
|
def venue(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.0.
|
4
|
+
version: 0.0.9
|
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-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|