fbrails 0.1.6 → 0.1.7

Sign up to get free protection for your applications and to get access to all the features.
data/lib/fbrails/graph.rb CHANGED
@@ -8,9 +8,18 @@ module Fbrails
8
8
  end
9
9
 
10
10
 
11
- def friends(ids=false)
11
+ def friends(fields = false)
12
12
  result = []
13
- friends = Fbrails.get(URL+"me"+"/"+"friends"+access_token)
13
+ if fields && fields.class == Array
14
+ params = "&fields=" + fields.join(",")
15
+ else
16
+ params = ""
17
+ end
18
+
19
+ friends = Fbrails.get(URL+"me"+"/"+"friends"+access_token+params)
20
+
21
+
22
+
14
23
  loop do
15
24
  if friends.has_key?("paging") && friends["paging"].has_key?("next")
16
25
  unless friends["data"].blank?
@@ -20,15 +29,7 @@ module Fbrails
20
29
  end
21
30
  end
22
31
  else
23
- if ids
24
- coll = []
25
- result.each do |fr|
26
- coll << fr["id"]
27
- end
28
- return coll
29
- else
30
- return result
31
- end
32
+ return result
32
33
  end
33
34
  friends = Fbrails.get(friends["paging"]["next"])
34
35
  end
@@ -1,3 +1,3 @@
1
1
  module Fbrails
2
- VERSION = "0.1.6"
2
+ VERSION = "0.1.7"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fbrails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.7
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -11,11 +11,11 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2011-10-27 00:00:00.000000000Z
14
+ date: 2011-10-30 00:00:00.000000000Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: httpclient
18
- requirement: &18340400 !ruby/object:Gem::Requirement
18
+ requirement: &14632800 !ruby/object:Gem::Requirement
19
19
  none: false
20
20
  requirements:
21
21
  - - ~>
@@ -23,7 +23,7 @@ dependencies:
23
23
  version: 2.2.2
24
24
  type: :runtime
25
25
  prerelease: false
26
- version_requirements: *18340400
26
+ version_requirements: *14632800
27
27
  description: Small gem for auth & getting info from facebook
28
28
  email:
29
29
  - donotsendhere@gmail.com