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:
parent
1b764ffa81
commit
49f0f7de6d
6 changed files with 66 additions and 1 deletions
12
lib/fb_graph2/edge/home.rb
Normal file
12
lib/fb_graph2/edge/home.rb
Normal 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
|
12
lib/fb_graph2/edge/links.rb
Normal file
12
lib/fb_graph2/edge/links.rb
Normal 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
|
12
lib/fb_graph2/edge/posts.rb
Normal file
12
lib/fb_graph2/edge/posts.rb
Normal 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
|
12
lib/fb_graph2/edge/statuses.rb
Normal file
12
lib/fb_graph2/edge/statuses.rb
Normal 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
|
12
lib/fb_graph2/edge/tagged.rb
Normal file
12
lib/fb_graph2/edge/tagged.rb
Normal 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
|
|
@ -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: [
|
||||
|
|
Loading…
Reference in a new issue