Module: FacebookProfile::InstanceMethods
- Defined in:
- app/models/facebook_profile.rb
Instance Method Summary collapse
- #facebook? ⇒ Boolean
- #facebook_authorization ⇒ Object
- #fb_friend_ids ⇒ Object
- #fb_friends_with?(user) ⇒ Boolean
- #graph ⇒ Object
Instance Method Details
#facebook? ⇒ Boolean
22 23 24 |
# File 'app/models/facebook_profile.rb', line 22 def facebook? end |
#facebook_authorization ⇒ Object
26 27 28 |
# File 'app/models/facebook_profile.rb', line 26 def self..where(:provider => "facebook").first end |
#fb_friend_ids ⇒ Object
10 11 12 |
# File 'app/models/facebook_profile.rb', line 10 def fb_friend_ids graph.get_connections('/me', 'friends').map{|h| h['id'].to_i} end |
#fb_friends_with?(user) ⇒ Boolean
14 15 16 |
# File 'app/models/facebook_profile.rb', line 14 def fb_friends_with?(user) fb_friend_ids.include?(user.profile[:id]) end |
#graph ⇒ Object
18 19 20 |
# File 'app/models/facebook_profile.rb', line 18 def graph @graph ||= Koala::Facebook::API.new(.token) end |