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

edges which returns an array of Post

This commit is contained in:
nov 2014-05-25 13:42:46 +09:00
parent 1b764ffa81
commit 49f0f7de6d
6 changed files with 66 additions and 1 deletions

View file

@ -0,0 +1,12 @@
module FbGraph2
class Edge
module Home
def home(params = {})
posts = self.edge :home, params
posts.collect do |post|
Post.new(post[:id], post).authenticate self.access_token
end
end
end
end
end

View file

@ -0,0 +1,12 @@
module FbGraph2
class Edge
module Links
def links(params = {})
posts = self.edge :links, params
posts.collect do |post|
Post.new(post[:id], post).authenticate self.access_token
end
end
end
end
end

View file

@ -0,0 +1,12 @@
module FbGraph2
class Edge
module Posts
def posts(params = {})
posts = self.edge :posts, params
posts.collect do |post|
Post.new(post[:id], post).authenticate self.access_token
end
end
end
end
end

View file

@ -0,0 +1,12 @@
module FbGraph2
class Edge
module Statuses
def statuses(params = {})
posts = self.edge :statuses, params
posts.collect do |post|
Post.new(post[:id], post).authenticate self.access_token
end
end
end
end
end

View file

@ -0,0 +1,12 @@
module FbGraph2
class Edge
module Tagged
def tagged(params = {})
posts = self.edge :tagged, params
posts.collect do |post|
Post.new(post[:id], post).authenticate self.access_token
end
end
end
end
end

View file

@ -1,8 +1,13 @@
module FbGraph2
class User < Node
include Edge::Accounts
include Edge::Friends
include Edge::Feed
include Edge::Friends
include Edge::Home
include Edge::Links
include Edge::Posts
include Edge::Statuses
include Edge::Tagged
register_attributes(
raw: [