From 49f0f7de6d3226c470eebb9d639c44901b18c115 Mon Sep 17 00:00:00 2001 From: nov Date: Sun, 25 May 2014 13:42:46 +0900 Subject: [PATCH] edges which returns an array of Post --- lib/fb_graph2/edge/home.rb | 12 ++++++++++++ lib/fb_graph2/edge/links.rb | 12 ++++++++++++ lib/fb_graph2/edge/posts.rb | 12 ++++++++++++ lib/fb_graph2/edge/statuses.rb | 12 ++++++++++++ lib/fb_graph2/edge/tagged.rb | 12 ++++++++++++ lib/fb_graph2/user.rb | 7 ++++++- 6 files changed, 66 insertions(+), 1 deletion(-) create mode 100644 lib/fb_graph2/edge/home.rb create mode 100644 lib/fb_graph2/edge/links.rb create mode 100644 lib/fb_graph2/edge/posts.rb create mode 100644 lib/fb_graph2/edge/statuses.rb create mode 100644 lib/fb_graph2/edge/tagged.rb diff --git a/lib/fb_graph2/edge/home.rb b/lib/fb_graph2/edge/home.rb new file mode 100644 index 0000000..11c12d0 --- /dev/null +++ b/lib/fb_graph2/edge/home.rb @@ -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 \ No newline at end of file diff --git a/lib/fb_graph2/edge/links.rb b/lib/fb_graph2/edge/links.rb new file mode 100644 index 0000000..ef8669b --- /dev/null +++ b/lib/fb_graph2/edge/links.rb @@ -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 \ No newline at end of file diff --git a/lib/fb_graph2/edge/posts.rb b/lib/fb_graph2/edge/posts.rb new file mode 100644 index 0000000..d388efb --- /dev/null +++ b/lib/fb_graph2/edge/posts.rb @@ -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 \ No newline at end of file diff --git a/lib/fb_graph2/edge/statuses.rb b/lib/fb_graph2/edge/statuses.rb new file mode 100644 index 0000000..dede679 --- /dev/null +++ b/lib/fb_graph2/edge/statuses.rb @@ -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 \ No newline at end of file diff --git a/lib/fb_graph2/edge/tagged.rb b/lib/fb_graph2/edge/tagged.rb new file mode 100644 index 0000000..b43229a --- /dev/null +++ b/lib/fb_graph2/edge/tagged.rb @@ -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 \ No newline at end of file diff --git a/lib/fb_graph2/user.rb b/lib/fb_graph2/user.rb index a3152e1..4f483d3 100644 --- a/lib/fb_graph2/user.rb +++ b/lib/fb_graph2/user.rb @@ -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: [