1
0
Fork 0
mirror of https://github.com/nov/fb_graph2 synced 2023-03-27 23:22:15 -04:00

family & friendlists

This commit is contained in:
nov 2014-05-25 15:05:11 +09:00
parent 0349beb157
commit c3c8798893
4 changed files with 37 additions and 1 deletions

View file

@ -0,0 +1,12 @@
module FbGraph2
class Edge
module Family
def family(params = {})
users = self.edge :family, params
users.collect do |user|
User.new(user[:id], user).authenticate self.access_token
end
end
end
end
end

View file

@ -0,0 +1,13 @@
module FbGraph2
class Edge
module FriendLists
def friend_lists(params = {})
friend_lists = self.edge :friendlists, params
friend_lists.collect do |friend_list|
FriendList.new(friend_list[:id], friend_list).authenticate self.access_token
end
end
alias_method :friendlists, :friend_lists
end
end
end

View file

@ -0,0 +1,7 @@
module FbGraph2
class FriendList < Node
register_attributes(
raw: [:name, :list_type]
)
end
end

View file

@ -6,7 +6,9 @@ module FbGraph2
include Edge::Albums
include Edge::Books
include Edge::Events
include Edge::Family
include Edge::Feed
include Edge::FriendLists
include Edge::Friends
include Edge::Games
include Edge::Home
@ -24,7 +26,9 @@ module FbGraph2
raw: [
:about, :bio, :email, :first_name, :gender, :installed, :is_verified, :link, :locale,
:middle_name, :name, :name_format, :political, :quotes, :relationship_status, :religion,
:timezone, :third_party_id, :verified, :website
:timezone, :third_party_id, :verified, :website,
# NOTE: in family edge context
:relationship
],
time: [:updated_time], # NOTE: undocumented attribute
date: [:birthday],