fb_graph 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (61) hide show
  1. data/VERSION +1 -1
  2. data/fb_graph.gemspec +53 -2
  3. data/lib/fb_graph/album.rb +26 -0
  4. data/lib/fb_graph/comment.rb +18 -0
  5. data/lib/fb_graph/connections/activities.rb +12 -0
  6. data/lib/fb_graph/connections/albums.rb +12 -0
  7. data/lib/fb_graph/connections/attending.rb +16 -0
  8. data/lib/fb_graph/connections/books.rb +12 -0
  9. data/lib/fb_graph/connections/comments.rb +12 -0
  10. data/lib/fb_graph/connections/declined.rb +16 -0
  11. data/lib/fb_graph/connections/events.rb +12 -0
  12. data/lib/fb_graph/connections/feed.rb +4 -1
  13. data/lib/fb_graph/connections/friends.rb +12 -0
  14. data/lib/fb_graph/connections/groups.rb +12 -0
  15. data/lib/fb_graph/connections/home.rb +4 -1
  16. data/lib/fb_graph/connections/interests.rb +12 -0
  17. data/lib/fb_graph/connections/invited.rb +16 -0
  18. data/lib/fb_graph/connections/links.rb +12 -0
  19. data/lib/fb_graph/connections/maybe.rb +16 -0
  20. data/lib/fb_graph/connections/members.rb +16 -0
  21. data/lib/fb_graph/connections/movies.rb +12 -0
  22. data/lib/fb_graph/connections/music.rb +12 -0
  23. data/lib/fb_graph/connections/noreply.rb +16 -0
  24. data/lib/fb_graph/connections/notes.rb +12 -0
  25. data/lib/fb_graph/connections/photos.rb +12 -0
  26. data/lib/fb_graph/connections/posts.rb +1 -4
  27. data/lib/fb_graph/connections/tagged.rb +4 -1
  28. data/lib/fb_graph/connections/television.rb +12 -0
  29. data/lib/fb_graph/connections/videos.rb +12 -0
  30. data/lib/fb_graph/event.rb +28 -0
  31. data/lib/fb_graph/group.rb +23 -0
  32. data/lib/fb_graph/link.rb +21 -0
  33. data/lib/fb_graph/note.rb +22 -0
  34. data/lib/fb_graph/page.rb +10 -0
  35. data/lib/fb_graph/photo.rb +42 -0
  36. data/lib/fb_graph/post.rb +7 -5
  37. data/lib/fb_graph/status.rb +5 -3
  38. data/lib/fb_graph/user.rb +21 -1
  39. data/lib/fb_graph/video.rb +23 -0
  40. data/lib/fb_graph.rb +11 -3
  41. data/spec/fake_json/users/activities/arjun_private.json +24 -0
  42. data/spec/fake_json/users/activities/arjun_public.json +6 -0
  43. data/spec/fake_json/users/feed/arjun_private.json +520 -0
  44. data/spec/fake_json/users/feed/arjun_public.json +520 -0
  45. data/spec/fake_json/users/friends/arjun_private.json +6 -0
  46. data/spec/fake_json/users/friends/arjun_public.json +6 -0
  47. data/spec/fake_json/users/friends/me_private.json +524 -0
  48. data/spec/fake_json/users/friends/me_public.json +6 -0
  49. data/spec/fake_json/users/posts/arjun_private.json +386 -0
  50. data/spec/fake_json/users/posts/arjun_public.json +386 -0
  51. data/spec/fake_json/users/tagged/arjun_private.json +308 -0
  52. data/spec/fake_json/users/tagged/arjun_public.json +308 -0
  53. data/spec/fb_graph/connections/activities_spec.rb +28 -0
  54. data/spec/fb_graph/connections/feed_spec.rb +34 -0
  55. data/spec/fb_graph/connections/friends_spec.rb +42 -0
  56. data/spec/fb_graph/connections/home_spec.rb +14 -2
  57. data/spec/fb_graph/connections/likes_spec.rb +0 -5
  58. data/spec/fb_graph/connections/posts_spec.rb +34 -0
  59. data/spec/fb_graph/connections/statuses_spec.rb +0 -19
  60. data/spec/fb_graph/connections/tagged_spec.rb +41 -0
  61. metadata +53 -2
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.1
1
+ 0.0.2
data/fb_graph.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{fb_graph}
8
- s.version = "0.0.1"
8
+ s.version = "0.0.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["nov matake"]
@@ -25,39 +25,85 @@ Gem::Specification.new do |s|
25
25
  "VERSION",
26
26
  "fb_graph.gemspec",
27
27
  "lib/fb_graph.rb",
28
+ "lib/fb_graph/album.rb",
29
+ "lib/fb_graph/comment.rb",
28
30
  "lib/fb_graph/connections.rb",
31
+ "lib/fb_graph/connections/activities.rb",
32
+ "lib/fb_graph/connections/albums.rb",
33
+ "lib/fb_graph/connections/attending.rb",
34
+ "lib/fb_graph/connections/books.rb",
29
35
  "lib/fb_graph/connections/collection.rb",
36
+ "lib/fb_graph/connections/comments.rb",
37
+ "lib/fb_graph/connections/declined.rb",
38
+ "lib/fb_graph/connections/events.rb",
30
39
  "lib/fb_graph/connections/feed.rb",
40
+ "lib/fb_graph/connections/friends.rb",
41
+ "lib/fb_graph/connections/groups.rb",
31
42
  "lib/fb_graph/connections/home.rb",
43
+ "lib/fb_graph/connections/interests.rb",
44
+ "lib/fb_graph/connections/invited.rb",
32
45
  "lib/fb_graph/connections/likes.rb",
46
+ "lib/fb_graph/connections/links.rb",
47
+ "lib/fb_graph/connections/maybe.rb",
48
+ "lib/fb_graph/connections/members.rb",
49
+ "lib/fb_graph/connections/movies.rb",
50
+ "lib/fb_graph/connections/music.rb",
51
+ "lib/fb_graph/connections/noreply.rb",
52
+ "lib/fb_graph/connections/notes.rb",
53
+ "lib/fb_graph/connections/photos.rb",
33
54
  "lib/fb_graph/connections/picture.rb",
34
55
  "lib/fb_graph/connections/posts.rb",
35
56
  "lib/fb_graph/connections/statuses.rb",
36
57
  "lib/fb_graph/connections/tagged.rb",
58
+ "lib/fb_graph/connections/television.rb",
59
+ "lib/fb_graph/connections/videos.rb",
60
+ "lib/fb_graph/event.rb",
61
+ "lib/fb_graph/group.rb",
62
+ "lib/fb_graph/link.rb",
37
63
  "lib/fb_graph/node.rb",
64
+ "lib/fb_graph/note.rb",
38
65
  "lib/fb_graph/page.rb",
66
+ "lib/fb_graph/photo.rb",
39
67
  "lib/fb_graph/post.rb",
40
68
  "lib/fb_graph/status.rb",
41
69
  "lib/fb_graph/user.rb",
70
+ "lib/fb_graph/video.rb",
42
71
  "spec/fake_json/pages/platform_private.json",
43
72
  "spec/fake_json/pages/platform_public.json",
44
73
  "spec/fake_json/pages/statuses/platform_private.json",
45
74
  "spec/fake_json/pages/statuses/platform_public.json",
75
+ "spec/fake_json/users/activities/arjun_private.json",
76
+ "spec/fake_json/users/activities/arjun_public.json",
46
77
  "spec/fake_json/users/arjun_private.json",
47
78
  "spec/fake_json/users/arjun_public.json",
79
+ "spec/fake_json/users/feed/arjun_private.json",
80
+ "spec/fake_json/users/feed/arjun_public.json",
81
+ "spec/fake_json/users/friends/arjun_private.json",
82
+ "spec/fake_json/users/friends/arjun_public.json",
83
+ "spec/fake_json/users/friends/me_private.json",
84
+ "spec/fake_json/users/friends/me_public.json",
48
85
  "spec/fake_json/users/home/arjun_private.json",
49
86
  "spec/fake_json/users/home/arjun_public.json",
50
87
  "spec/fake_json/users/home/me_private.json",
51
88
  "spec/fake_json/users/home/me_public.json",
52
89
  "spec/fake_json/users/likes/arjun_private.json",
53
90
  "spec/fake_json/users/likes/arjun_public.json",
91
+ "spec/fake_json/users/posts/arjun_private.json",
92
+ "spec/fake_json/users/posts/arjun_public.json",
54
93
  "spec/fake_json/users/statuses/arjun_private.json",
55
94
  "spec/fake_json/users/statuses/arjun_public.json",
95
+ "spec/fake_json/users/tagged/arjun_private.json",
96
+ "spec/fake_json/users/tagged/arjun_public.json",
97
+ "spec/fb_graph/connections/activities_spec.rb",
56
98
  "spec/fb_graph/connections/collection_spec.rb",
99
+ "spec/fb_graph/connections/feed_spec.rb",
100
+ "spec/fb_graph/connections/friends_spec.rb",
57
101
  "spec/fb_graph/connections/home_spec.rb",
58
102
  "spec/fb_graph/connections/likes_spec.rb",
59
103
  "spec/fb_graph/connections/picture_spec.rb",
104
+ "spec/fb_graph/connections/posts_spec.rb",
60
105
  "spec/fb_graph/connections/statuses_spec.rb",
106
+ "spec/fb_graph/connections/tagged_spec.rb",
61
107
  "spec/fb_graph/node_spec.rb",
62
108
  "spec/fb_graph/page_spec.rb",
63
109
  "spec/fb_graph/user_spec.rb",
@@ -72,11 +118,16 @@ Gem::Specification.new do |s|
72
118
  s.rubygems_version = %q{1.3.6}
73
119
  s.summary = %q{Facebook Graph API library for Ruby}
74
120
  s.test_files = [
75
- "spec/fb_graph/connections/collection_spec.rb",
121
+ "spec/fb_graph/connections/activities_spec.rb",
122
+ "spec/fb_graph/connections/collection_spec.rb",
123
+ "spec/fb_graph/connections/feed_spec.rb",
124
+ "spec/fb_graph/connections/friends_spec.rb",
76
125
  "spec/fb_graph/connections/home_spec.rb",
77
126
  "spec/fb_graph/connections/likes_spec.rb",
78
127
  "spec/fb_graph/connections/picture_spec.rb",
128
+ "spec/fb_graph/connections/posts_spec.rb",
79
129
  "spec/fb_graph/connections/statuses_spec.rb",
130
+ "spec/fb_graph/connections/tagged_spec.rb",
80
131
  "spec/fb_graph/node_spec.rb",
81
132
  "spec/fb_graph/page_spec.rb",
82
133
  "spec/fb_graph/user_spec.rb",
@@ -0,0 +1,26 @@
1
+ module FbGraph
2
+ class Photo < Node
3
+ include Connections::Photos
4
+ include Connections::Comments
5
+
6
+ attr_accessor :from, :name, :description, :location, :link, :count, :created_time, :updated_time
7
+
8
+ def initialize(identifier, options = {})
9
+ super
10
+ if (from = options[:from])
11
+ @from = if from[:category]
12
+ FbGraph::Page.new(from.delete(:id), from)
13
+ else
14
+ FbGraph::User.new(from.delete(:id), from)
15
+ end
16
+ end
17
+ @name = options[:name]
18
+ @description = options[:description]
19
+ @location = options[:location]
20
+ @link = options[:link]
21
+ @count = options[:count]
22
+ @created_time = options[:created_time]
23
+ @updated_time = options[:updated_time]
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,18 @@
1
+ module FbGraph
2
+ class Comment < Node
3
+ attr_accessor :from, :message, :created_time
4
+
5
+ def initialize(identifier, options = {})
6
+ super
7
+ if (from = options[:from])
8
+ @from = if from[:category]
9
+ FbGraph::Page.new(from.delete(:id), from)
10
+ else
11
+ FbGraph::User.new(from.delete(:id), from)
12
+ end
13
+ end
14
+ @message = options[:message]
15
+ @created_time = options[:created_time]
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,12 @@
1
+ module FbGraph
2
+ module Connections
3
+ module Activities
4
+ def activities(options = {})
5
+ activities = Collection.new(get(options.merge(:connection => 'activities')))
6
+ activities.map! do |activity|
7
+ Page.new(activity.delete(:id), activity)
8
+ end
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,12 @@
1
+ module FbGraph
2
+ module Connections
3
+ module Albums
4
+ def albums(options = {})
5
+ albums = Collection.new(get(options.merge(:connection => 'albums')))
6
+ albums.map! do |album|
7
+ Album.new(album.delete(:id), album)
8
+ end
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,16 @@
1
+ module FbGraph
2
+ module Connections
3
+ module Attending
4
+ def attending(options = {})
5
+ members = Collection.new(get(options.merge(:connection => 'attending')))
6
+ members.map! do |member|
7
+ if member[:category]
8
+ Page.new(member.delete(:id), member)
9
+ else
10
+ User.new(member.delete(:id), member)
11
+ end
12
+ end
13
+ end
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,12 @@
1
+ module FbGraph
2
+ module Connections
3
+ module Books
4
+ def books(options = {})
5
+ books = Collection.new(get(options.merge(:connection => 'books')))
6
+ books.map! do |book|
7
+ Page.new(book.delete(:id), book)
8
+ end
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,12 @@
1
+ module FbGraph
2
+ module Connections
3
+ module Comments
4
+ def comments(options = {})
5
+ comments = Collection.new(get(options.merge(:connection => 'comment')))
6
+ comments.map! do |comment|
7
+ Comment.new(comment.delete(:id), comment)
8
+ end
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,16 @@
1
+ module FbGraph
2
+ module Connections
3
+ module Declined
4
+ def declined(options = {})
5
+ members = Collection.new(get(options.merge(:connection => 'declined')))
6
+ members.map! do |member|
7
+ if member[:category]
8
+ Page.new(member.delete(:id), member)
9
+ else
10
+ User.new(member.delete(:id), member)
11
+ end
12
+ end
13
+ end
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,12 @@
1
+ module FbGraph
2
+ module Connections
3
+ module Events
4
+ def events(options = {})
5
+ events = Collection.new(get(options.merge(:connection => 'events')))
6
+ events.map! do |event|
7
+ Event.new(event.delete(:id), event)
8
+ end
9
+ end
10
+ end
11
+ end
12
+ end
@@ -2,7 +2,10 @@ module FbGraph
2
2
  module Connections
3
3
  module Feed
4
4
  def feed(options = {})
5
- Posts.posts(options.merge(:connection => 'feed', :self => self))
5
+ posts = Collection.new(get(options.merge(:connection => 'feed')))
6
+ posts.map! do |post|
7
+ Post.new(post.delete(:id), post)
8
+ end
6
9
  end
7
10
  end
8
11
  end
@@ -0,0 +1,12 @@
1
+ module FbGraph
2
+ module Connections
3
+ module Friends
4
+ def friends(options = {})
5
+ users = Collection.new(get(options.merge(:connection => 'friends')))
6
+ users.map! do |user|
7
+ User.new(user.delete(:id), user)
8
+ end
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,12 @@
1
+ module FbGraph
2
+ module Connections
3
+ module Groups
4
+ def groups(options = {})
5
+ groups = Collection.new(get(options.merge(:connection => 'groups')))
6
+ groups.map! do |group|
7
+ Group.new(group.delete(:id), group)
8
+ end
9
+ end
10
+ end
11
+ end
12
+ end
@@ -2,7 +2,10 @@ module FbGraph
2
2
  module Connections
3
3
  module Home
4
4
  def home(options = {})
5
- Posts.posts(options.merge(:connection => 'home', :self => self))
5
+ posts = Collection.new(get(options.merge(:connection => 'home')))
6
+ posts.map! do |post|
7
+ Post.new(post.delete(:id), post)
8
+ end
6
9
  end
7
10
  end
8
11
  end
@@ -0,0 +1,12 @@
1
+ module FbGraph
2
+ module Connections
3
+ module Interests
4
+ def interests(options = {})
5
+ interests = Collection.new(get(options.merge(:connection => 'interests')))
6
+ interests.map! do |interest|
7
+ Page.new(interest.delete(:id), interest)
8
+ end
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,16 @@
1
+ module FbGraph
2
+ module Connections
3
+ module Invited
4
+ def invited(options = {})
5
+ members = Collection.new(get(options.merge(:connection => 'invited')))
6
+ members.map! do |member|
7
+ if member[:category]
8
+ Page.new(member.delete(:id), member)
9
+ else
10
+ User.new(member.delete(:id), member)
11
+ end
12
+ end
13
+ end
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,12 @@
1
+ module FbGraph
2
+ module Connections
3
+ module Links
4
+ def links(options = {})
5
+ links = Collection.new(get(options.merge(:connection => 'links')))
6
+ links.map! do |link|
7
+ Link.new(link.delete(:id), link)
8
+ end
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,16 @@
1
+ module FbGraph
2
+ module Connections
3
+ module Maybe
4
+ def maybe(options = {})
5
+ members = Collection.new(get(options.merge(:connection => 'maybe')))
6
+ members.map! do |member|
7
+ if member[:category]
8
+ Page.new(member.delete(:id), member)
9
+ else
10
+ User.new(member.delete(:id), member)
11
+ end
12
+ end
13
+ end
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,16 @@
1
+ module FbGraph
2
+ module Connections
3
+ module Members
4
+ def members(options = {})
5
+ members = Collection.new(get(options.merge(:connection => 'members')))
6
+ member.map! do |member|
7
+ if member[:category]
8
+ Page.new(member.delete(:id), member)
9
+ else
10
+ User.new(member.delete(:id), member)
11
+ end
12
+ end
13
+ end
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,12 @@
1
+ module FbGraph
2
+ module Connections
3
+ module Movies
4
+ def movies(options = {})
5
+ movies = Collection.new(get(options.merge(:connection => 'movies')))
6
+ movies.map! do |movie|
7
+ Page.new(movie.delete(:id), movie)
8
+ end
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,12 @@
1
+ module FbGraph
2
+ module Connections
3
+ module Music
4
+ def music(options = {})
5
+ music = Collection.new(get(options.merge(:connection => 'music')))
6
+ music.map! do |_music_|
7
+ Page.new(_music_.delete(:id), _music_)
8
+ end
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,16 @@
1
+ module FbGraph
2
+ module Connections
3
+ module Noreply
4
+ def noreply(options = {})
5
+ members = Collection.new(get(options.merge(:connection => 'noreply')))
6
+ members.map! do |member|
7
+ if member[:category]
8
+ Page.new(member.delete(:id), member)
9
+ else
10
+ User.new(member.delete(:id), member)
11
+ end
12
+ end
13
+ end
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,12 @@
1
+ module FbGraph
2
+ module Connections
3
+ module Notes
4
+ def notes(options = {})
5
+ notes = Collection.new(get(options.merge(:connection => 'notes')))
6
+ notes.map! do |note|
7
+ Note.new(note.delete(:id), note)
8
+ end
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,12 @@
1
+ module FbGraph
2
+ module Connections
3
+ module Photos
4
+ def photos(options = {})
5
+ photos = Collection.new(get(options.merge(:connection => 'photos')))
6
+ photos.map! do |photo|
7
+ Photo.new(photo.delete(:id), photo)
8
+ end
9
+ end
10
+ end
11
+ end
12
+ end
@@ -2,14 +2,11 @@ module FbGraph
2
2
  module Connections
3
3
  module Posts
4
4
  def posts(options = {})
5
- options[:connection] ||= 'posts'
6
- __self__ = options.delete(:self) || self
7
- posts = Collection.new(__self__.send(:get, options))
5
+ posts = Collection.new(get(options.merge(:connection => 'posts')))
8
6
  posts.map! do |post|
9
7
  Post.new(post.delete(:id), post)
10
8
  end
11
9
  end
12
- module_function :posts
13
10
  end
14
11
  end
15
12
  end
@@ -2,7 +2,10 @@ module FbGraph
2
2
  module Connections
3
3
  module Tagged
4
4
  def tagged(options = {})
5
- Posts.posts(options.merge(:connection => 'tagged', :self => self))
5
+ posts = Collection.new(get(options.merge(:connection => 'tagged')))
6
+ posts.map! do |post|
7
+ Post.new(post.delete(:id), post)
8
+ end
6
9
  end
7
10
  end
8
11
  end
@@ -0,0 +1,12 @@
1
+ module FbGraph
2
+ module Connections
3
+ module Television
4
+ def television(options = {})
5
+ television = Collection.new(get(options.merge(:connection => 'television')))
6
+ television.map! do |_television_|
7
+ Page.new(_television_.delete(:id), _television_)
8
+ end
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,12 @@
1
+ module FbGraph
2
+ module Connections
3
+ module Videos
4
+ def videos(options = {})
5
+ videos = Collection.new(get(options.merge(:connection => 'videos')))
6
+ videos.map! do |video|
7
+ Video.new(video.delete(:id), video)
8
+ end
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,28 @@
1
+ module FbGraph
2
+ class Event < Node
3
+ include Connections::Feed
4
+ include Connections::Noreply
5
+ include Connections::Maybe
6
+ include Connections::Invited
7
+ include Connections::Attending
8
+ include Connections::Declined
9
+ include Connections::Picture
10
+
11
+ attr_accessor :owner, :name, :description, :start_time, :end_time, :location, :venue, :privacy, :updated_time
12
+
13
+ def initialize(identifier, options = {})
14
+ super
15
+ if (owner = options[:owner])
16
+ @owner = FbGraph::User.new(owner.delete(:id), owner)
17
+ end
18
+ @name = options[:name]
19
+ @description = options[:description]
20
+ @start_time = options[:start_time]
21
+ @end_time = options[:end_time]
22
+ @location = options[:location]
23
+ @venue = options[:venue]
24
+ @privacy = options[:privacy]
25
+ @updated_time = options[:updated_time]
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,23 @@
1
+ module FbGraph
2
+ class Group < Node
3
+ include Connections::Feed
4
+ include Connections::Members
5
+ include Connections::Picture
6
+
7
+ attr_accessor :owner, :name, :description, :link, :venue, :longitude, :privacy, :updated_time
8
+
9
+ def initialize(identifier, options = {})
10
+ super
11
+ if (owner = options[:owner])
12
+ @owner = FbGraph::User.new(owner.delete(:id), owner)
13
+ end
14
+ @name = options[:name]
15
+ @description = options[:description]
16
+ @link = options[:link]
17
+ @venue = options[:venue]
18
+ @longitude = options[:longitude]
19
+ @privacy = options[:privacy]
20
+ @updated_time = options[:updated_time]
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,21 @@
1
+ module FbGraph
2
+ class Page < Node
3
+ include Connections::Comments
4
+
5
+ attr_accessor :from, :link, :message, :updated_time
6
+
7
+ def initialize(identifier, options = {})
8
+ super
9
+ if (from = options[:from])
10
+ @from = if from[:category]
11
+ FbGraph::Page.new(from.delete(:id), from)
12
+ else
13
+ FbGraph::User.new(from.delete(:id), from)
14
+ end
15
+ end
16
+ @link = options[:link]
17
+ @message = options[:message]
18
+ @updated_time = options[:updated_time]
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,22 @@
1
+ module FbGraph
2
+ class Note < Node
3
+ include Connections::Comments
4
+
5
+ attr_accessor :from, :subject, :message, :created_time, :updated_time
6
+
7
+ def initialize(identifier, options = {})
8
+ super
9
+ if (from = options[:from])
10
+ @from = if from[:category]
11
+ FbGraph::Page.new(from.delete(:id), from)
12
+ else
13
+ FbGraph::User.new(from.delete(:id), from)
14
+ end
15
+ end
16
+ @subject = options[:subject]
17
+ @message = options[:message]
18
+ @created_time = options[:created_time]
19
+ @updated_time = options[:updated_time]
20
+ end
21
+ end
22
+ end
data/lib/fb_graph/page.rb CHANGED
@@ -1,7 +1,17 @@
1
1
  module FbGraph
2
2
  class Page < Node
3
+ include Connections::Feed
3
4
  include Connections::Picture
5
+ include Connections::Tagged
6
+ include Connections::Links
7
+ include Connections::Photos
8
+ include Connections::Groups
9
+ include Connections::Albums
4
10
  include Connections::Statuses
11
+ include Connections::Videos
12
+ include Connections::Notes
13
+ include Connections::Posts
14
+ include Connections::Events
5
15
 
6
16
  attr_accessor :name, :category
7
17