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 CHANGED
@@ -1 +1 @@
1
- 1.0.3
1
+ 1.0.4
@@ -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.3"
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-14}
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 = [
@@ -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
- collection[:data] ||= []
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: 17
4
+ hash: 31
5
5
  prerelease: false
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
- - 3
10
- version: 1.0.3
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-14 00:00:00 +09:00
18
+ date: 2010-09-15 00:00:00 +09:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency