fb_graph 1.0.3 → 1.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/fb_graph.gemspec +2 -2
- data/lib/fb_graph/collection.rb +11 -2
- metadata +4 -4
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0.
|
1
|
+
1.0.4
|
data/fb_graph.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{fb_graph}
|
8
|
-
s.version = "1.0.
|
8
|
+
s.version = "1.0.4"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["nov matake"]
|
12
|
-
s.date = %q{2010-09-
|
12
|
+
s.date = %q{2010-09-15}
|
13
13
|
s.description = %q{A full-stack Facebook Graph API wrapper in Ruby.}
|
14
14
|
s.email = %q{nov@matake.jp}
|
15
15
|
s.extra_rdoc_files = [
|
data/lib/fb_graph/collection.rb
CHANGED
@@ -3,8 +3,17 @@ module FbGraph
|
|
3
3
|
attr_reader :previous, :next, :total_count
|
4
4
|
|
5
5
|
def initialize(collection = nil)
|
6
|
-
collection
|
7
|
-
|
6
|
+
collection = case collection
|
7
|
+
when Array
|
8
|
+
{:data => collection, :count => collection.size}
|
9
|
+
when Hash
|
10
|
+
collection[:data] ||= []
|
11
|
+
collection
|
12
|
+
when nil
|
13
|
+
collection = {:data => [], :count => 0}
|
14
|
+
else
|
15
|
+
raise "Invalid collection"
|
16
|
+
end
|
8
17
|
result = replace(collection[:data])
|
9
18
|
@total_count = collection[:count]
|
10
19
|
@previous, @next = {}, {}
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fb_graph
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 31
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 1.0.
|
9
|
+
- 4
|
10
|
+
version: 1.0.4
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- nov matake
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-09-
|
18
|
+
date: 2010-09-15 00:00:00 +09:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|