fb_graph 1.8.0 → 1.8.1
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +1 -1
- data/VERSION +1 -1
- data/lib/fb_graph/album.rb +2 -2
- data/lib/fb_graph/app_request.rb +3 -3
- data/lib/fb_graph/checkin.rb +5 -5
- data/lib/fb_graph/comment.rb +2 -2
- data/lib/fb_graph/connections/accounts.rb +1 -1
- data/lib/fb_graph/connections/activities.rb +1 -1
- data/lib/fb_graph/connections/albums.rb +2 -2
- data/lib/fb_graph/connections/app_requests.rb +1 -1
- data/lib/fb_graph/connections/attending.rb +1 -1
- data/lib/fb_graph/connections/books.rb +1 -1
- data/lib/fb_graph/connections/checkins.rb +2 -2
- data/lib/fb_graph/connections/comments.rb +2 -2
- data/lib/fb_graph/connections/declined.rb +1 -1
- data/lib/fb_graph/connections/events.rb +2 -2
- data/lib/fb_graph/connections/family.rb +1 -1
- data/lib/fb_graph/connections/feed.rb +2 -2
- data/lib/fb_graph/connections/former_participants.rb +1 -1
- data/lib/fb_graph/connections/friend_lists.rb +1 -1
- data/lib/fb_graph/connections/friends.rb +1 -1
- data/lib/fb_graph/connections/games.rb +1 -1
- data/lib/fb_graph/connections/groups.rb +1 -1
- data/lib/fb_graph/connections/home.rb +1 -1
- data/lib/fb_graph/connections/insights.rb +1 -1
- data/lib/fb_graph/connections/interests.rb +1 -1
- data/lib/fb_graph/connections/invited.rb +1 -1
- data/lib/fb_graph/connections/likes.rb +2 -3
- data/lib/fb_graph/connections/links.rb +2 -2
- data/lib/fb_graph/connections/maybe.rb +1 -1
- data/lib/fb_graph/connections/members.rb +1 -1
- data/lib/fb_graph/connections/messages.rb +1 -1
- data/lib/fb_graph/connections/movies.rb +1 -1
- data/lib/fb_graph/connections/music.rb +1 -1
- data/lib/fb_graph/connections/noreply.rb +1 -1
- data/lib/fb_graph/connections/notes.rb +2 -2
- data/lib/fb_graph/connections/participants.rb +1 -1
- data/lib/fb_graph/connections/payments.rb +1 -1
- data/lib/fb_graph/connections/photos.rb +2 -2
- data/lib/fb_graph/connections/posts.rb +1 -1
- data/lib/fb_graph/connections/senders.rb +1 -1
- data/lib/fb_graph/connections/statuses.rb +1 -1
- data/lib/fb_graph/connections/tagged.rb +1 -1
- data/lib/fb_graph/connections/television.rb +1 -1
- data/lib/fb_graph/connections/test_users.rb +2 -2
- data/lib/fb_graph/connections/threads.rb +1 -1
- data/lib/fb_graph/connections/videos.rb +1 -1
- data/lib/fb_graph/education.rb +5 -5
- data/lib/fb_graph/event.rb +1 -1
- data/lib/fb_graph/group.rb +1 -1
- data/lib/fb_graph/klass.rb +1 -1
- data/lib/fb_graph/link.rb +2 -2
- data/lib/fb_graph/message.rb +2 -2
- data/lib/fb_graph/node.rb +1 -1
- data/lib/fb_graph/note.rb +2 -2
- data/lib/fb_graph/order.rb +3 -3
- data/lib/fb_graph/photo.rb +2 -2
- data/lib/fb_graph/post.rb +7 -7
- data/lib/fb_graph/searchable.rb +1 -1
- data/lib/fb_graph/status.rb +3 -3
- data/lib/fb_graph/tag.rb +6 -6
- data/lib/fb_graph/user.rb +8 -8
- data/lib/fb_graph/video.rb +2 -2
- data/lib/fb_graph/work.rb +5 -5
- metadata +2 -2
data/Gemfile.lock
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.8.
|
1
|
+
1.8.1
|
data/lib/fb_graph/album.rb
CHANGED
@@ -11,9 +11,9 @@ module FbGraph
|
|
11
11
|
super
|
12
12
|
@from = if (from = attributes[:from])
|
13
13
|
if from[:category]
|
14
|
-
Page.new(from
|
14
|
+
Page.new(from[:id], from)
|
15
15
|
else
|
16
|
-
User.new(from
|
16
|
+
User.new(from[:id], from)
|
17
17
|
end
|
18
18
|
end
|
19
19
|
@name = attributes[:name]
|
data/lib/fb_graph/app_request.rb
CHANGED
@@ -8,13 +8,13 @@ module FbGraph
|
|
8
8
|
@data = attributes[:data]
|
9
9
|
@message = attributes[:message]
|
10
10
|
if attributes[:from]
|
11
|
-
@from = User.new(attributes[:from]
|
11
|
+
@from = User.new(attributes[:from][:id], attributes[:from])
|
12
12
|
end
|
13
13
|
if attributes[:to]
|
14
|
-
@to = User.new(attributes[:to]
|
14
|
+
@to = User.new(attributes[:to][:id], attributes[:to])
|
15
15
|
end
|
16
16
|
if attributes[:application]
|
17
|
-
@application = Application.new(attributes[:application]
|
17
|
+
@application = Application.new(attributes[:application][:id], attributes[:application])
|
18
18
|
end
|
19
19
|
if attributes[:created_time]
|
20
20
|
@created_time = Time.parse(attributes[:created_time]).utc
|
data/lib/fb_graph/checkin.rb
CHANGED
@@ -7,12 +7,12 @@ module FbGraph
|
|
7
7
|
def initialize(identifier, attributes = {})
|
8
8
|
super
|
9
9
|
if (from = attributes[:from])
|
10
|
-
@from = User.new(from
|
10
|
+
@from = User.new(from[:id], from)
|
11
11
|
end
|
12
12
|
@tags = []
|
13
13
|
if (tags = attributes[:tags])
|
14
14
|
Collection.new(tags).each do |user|
|
15
|
-
@tags << User.new(user
|
15
|
+
@tags << User.new(user[:id], user)
|
16
16
|
end
|
17
17
|
end
|
18
18
|
if (place = attributes[:place])
|
@@ -22,14 +22,14 @@ module FbGraph
|
|
22
22
|
when String, Integer
|
23
23
|
Place.new(place)
|
24
24
|
when Hash
|
25
|
-
Place.new(place
|
25
|
+
Place.new(place[:id], place)
|
26
26
|
end
|
27
27
|
end
|
28
28
|
@message = attributes[:message]
|
29
29
|
if (application = attributes[:application])
|
30
|
-
@application = Application.new(application
|
30
|
+
@application = Application.new(application[:id], application)
|
31
31
|
end
|
32
|
-
if (created_time = attributes
|
32
|
+
if (created_time = attributes[:created_time])
|
33
33
|
@created_time = Time.parse(created_time).utc
|
34
34
|
end
|
35
35
|
end
|
data/lib/fb_graph/comment.rb
CHANGED
@@ -8,9 +8,9 @@ module FbGraph
|
|
8
8
|
super
|
9
9
|
if (from = attributes[:from])
|
10
10
|
@from = if from[:category]
|
11
|
-
Page.new(from
|
11
|
+
Page.new(from[:id], from)
|
12
12
|
else
|
13
|
-
User.new(from
|
13
|
+
User.new(from[:id], from)
|
14
14
|
end
|
15
15
|
end
|
16
16
|
@message = attributes[:message]
|
@@ -4,7 +4,7 @@ module FbGraph
|
|
4
4
|
def activities(options = {})
|
5
5
|
activities = self.connection(:activities, options)
|
6
6
|
activities.map! do |activity|
|
7
|
-
Page.new(activity
|
7
|
+
Page.new(activity[:id], activity.merge(
|
8
8
|
:access_token => options[:access_token] || self.access_token
|
9
9
|
))
|
10
10
|
end
|
@@ -4,7 +4,7 @@ module FbGraph
|
|
4
4
|
def albums(options = {})
|
5
5
|
albums = self.connection(:albums, options)
|
6
6
|
albums.map! do |album|
|
7
|
-
Album.new(album
|
7
|
+
Album.new(album[:id], album.merge(
|
8
8
|
:access_token => options[:access_token] || self.access_token
|
9
9
|
))
|
10
10
|
end
|
@@ -12,7 +12,7 @@ module FbGraph
|
|
12
12
|
|
13
13
|
def album!(options = {})
|
14
14
|
album = post(options.merge(:connection => :albums))
|
15
|
-
Album.new(album
|
15
|
+
Album.new(album[:id], options.merge(album).merge(
|
16
16
|
:access_token => options[:access_token] || self.access_token
|
17
17
|
))
|
18
18
|
end
|
@@ -4,7 +4,7 @@ module FbGraph
|
|
4
4
|
def app_requests(options = {})
|
5
5
|
app_requests = self.connection(:apprequests, options)
|
6
6
|
app_requests.map! do |app_request|
|
7
|
-
AppRequest.new(app_request
|
7
|
+
AppRequest.new(app_request[:id], app_request.merge(
|
8
8
|
:access_token => options[:access_token] || self.access_token
|
9
9
|
))
|
10
10
|
end
|
@@ -4,7 +4,7 @@ module FbGraph
|
|
4
4
|
def attending(options = {})
|
5
5
|
members = self.connection(:attending, options)
|
6
6
|
members.map! do |member|
|
7
|
-
User.new(member
|
7
|
+
User.new(member[:id], member.merge(
|
8
8
|
:access_token => options[:access_token] || self.access_token
|
9
9
|
))
|
10
10
|
end
|
@@ -4,7 +4,7 @@ module FbGraph
|
|
4
4
|
def checkins(options = {})
|
5
5
|
checkins = self.connection(:checkins, options)
|
6
6
|
checkins.map! do |checkin|
|
7
|
-
Checkin.new(checkin
|
7
|
+
Checkin.new(checkin[:id], checkin.merge(
|
8
8
|
:access_token => options[:access_token] || self.access_token
|
9
9
|
))
|
10
10
|
end
|
@@ -12,7 +12,7 @@ module FbGraph
|
|
12
12
|
|
13
13
|
def checkin!(options = {})
|
14
14
|
checkin = post(options.merge(:connection => :checkins))
|
15
|
-
Checkin.new(checkin
|
15
|
+
Checkin.new(checkin[:id], options.merge(checkin).merge(
|
16
16
|
:access_token => options[:access_token] || self.access_token
|
17
17
|
))
|
18
18
|
end
|
@@ -8,7 +8,7 @@ module FbGraph
|
|
8
8
|
self.connection(:comments, options)
|
9
9
|
end
|
10
10
|
comments.map! do |comment|
|
11
|
-
Comment.new(comment
|
11
|
+
Comment.new(comment[:id], comment.merge(
|
12
12
|
:access_token => options[:access_token] || self.access_token
|
13
13
|
))
|
14
14
|
end
|
@@ -16,7 +16,7 @@ module FbGraph
|
|
16
16
|
|
17
17
|
def comment!(options = {})
|
18
18
|
comment = post(options.merge(:connection => :comments))
|
19
|
-
Comment.new(comment
|
19
|
+
Comment.new(comment[:id], options.merge(comment).merge(
|
20
20
|
:access_token => options[:access_token] || self.access_token
|
21
21
|
))
|
22
22
|
end
|
@@ -4,7 +4,7 @@ module FbGraph
|
|
4
4
|
def declined(options = {})
|
5
5
|
members = self.connection(:declined, options)
|
6
6
|
members.map! do |member|
|
7
|
-
User.new(member
|
7
|
+
User.new(member[:id], member.merge(
|
8
8
|
:access_token => options[:access_token] || self.access_token
|
9
9
|
))
|
10
10
|
end
|
@@ -4,7 +4,7 @@ module FbGraph
|
|
4
4
|
def events(options = {})
|
5
5
|
events = self.connection(:events, options)
|
6
6
|
events.map! do |event|
|
7
|
-
Event.new(event
|
7
|
+
Event.new(event[:id], event.merge(
|
8
8
|
:access_token => options[:access_token] || self.access_token
|
9
9
|
))
|
10
10
|
end
|
@@ -12,7 +12,7 @@ module FbGraph
|
|
12
12
|
|
13
13
|
def event!(options = {})
|
14
14
|
event = post(options.merge(:connection => :events))
|
15
|
-
Event.new(event
|
15
|
+
Event.new(event[:id], options.merge(event).merge(
|
16
16
|
:access_token => options[:access_token] || self.access_token
|
17
17
|
))
|
18
18
|
end
|
@@ -4,7 +4,7 @@ module FbGraph
|
|
4
4
|
def feed(options = {})
|
5
5
|
posts = self.connection(:feed, options)
|
6
6
|
posts.map! do |post|
|
7
|
-
Post.new(post
|
7
|
+
Post.new(post[:id], post.merge(
|
8
8
|
:context => self.class,
|
9
9
|
:access_token => options[:access_token] || self.access_token
|
10
10
|
))
|
@@ -13,7 +13,7 @@ module FbGraph
|
|
13
13
|
|
14
14
|
def feed!(options = {})
|
15
15
|
post = post(options.merge(:connection => :feed))
|
16
|
-
Post.new(post
|
16
|
+
Post.new(post[:id], options.merge(post).merge(
|
17
17
|
:access_token => options[:access_token] || self.access_token
|
18
18
|
))
|
19
19
|
end
|
@@ -4,7 +4,7 @@ module FbGraph
|
|
4
4
|
def friend_lists(options = {})
|
5
5
|
friend_lists = self.connection(:friendlists, options)
|
6
6
|
friend_lists.map! do |friend_list|
|
7
|
-
FriendList.new(friend_list
|
7
|
+
FriendList.new(friend_list[:id], friend_list.merge(
|
8
8
|
:access_token => options[:access_token] || self.access_token
|
9
9
|
))
|
10
10
|
end
|
@@ -4,7 +4,7 @@ module FbGraph
|
|
4
4
|
def groups(options = {})
|
5
5
|
groups = self.connection(:groups, options)
|
6
6
|
groups.map! do |group|
|
7
|
-
Group.new(group
|
7
|
+
Group.new(group[:id], group.merge(
|
8
8
|
:access_token => options[:access_token] || self.access_token
|
9
9
|
))
|
10
10
|
end
|
@@ -6,7 +6,7 @@ module FbGraph
|
|
6
6
|
options[:access_token] ||= get_access_token(options[:secret]) if respond_to?(:get_access_token)
|
7
7
|
insights = self.connection(:insights, options.merge(:connection_scope => connection_scope(options)))
|
8
8
|
insights.map! do |insight|
|
9
|
-
Insight.new(insight
|
9
|
+
Insight.new(insight[:id], insight.merge(:access_token => options[:access_token]))
|
10
10
|
end
|
11
11
|
end
|
12
12
|
|
@@ -4,7 +4,7 @@ module FbGraph
|
|
4
4
|
def interests(options = {})
|
5
5
|
interests = self.connection(:interests, options)
|
6
6
|
interests.map! do |interest|
|
7
|
-
Page.new(interest
|
7
|
+
Page.new(interest[:id], interest.merge(
|
8
8
|
:access_token => options[:access_token] || self.access_token
|
9
9
|
))
|
10
10
|
end
|
@@ -4,7 +4,7 @@ module FbGraph
|
|
4
4
|
def invited(options = {})
|
5
5
|
members = self.connection(:invited, options)
|
6
6
|
members.map! do |member|
|
7
|
-
User.new(member
|
7
|
+
User.new(member[:id], member.merge(
|
8
8
|
:access_token => options[:access_token] || self.access_token
|
9
9
|
))
|
10
10
|
end
|
@@ -8,14 +8,13 @@ module FbGraph
|
|
8
8
|
self.connection(:likes, options)
|
9
9
|
end
|
10
10
|
likes.map! do |like|
|
11
|
-
identifier = like.delete(:id)
|
12
11
|
like.merge!(
|
13
12
|
:access_token => options[:access_token] || self.access_token
|
14
13
|
)
|
15
14
|
if like[:category]
|
16
|
-
Page.new(
|
15
|
+
Page.new(like[:id], like)
|
17
16
|
else
|
18
|
-
User.new(
|
17
|
+
User.new(like[:id], like)
|
19
18
|
end
|
20
19
|
end
|
21
20
|
end
|
@@ -4,7 +4,7 @@ module FbGraph
|
|
4
4
|
def links(options = {})
|
5
5
|
links = self.connection(:links, options)
|
6
6
|
links.map! do |link|
|
7
|
-
Link.new(link
|
7
|
+
Link.new(link[:id], link.merge(
|
8
8
|
:access_token => options[:access_token] || self.access_token
|
9
9
|
))
|
10
10
|
end
|
@@ -12,7 +12,7 @@ module FbGraph
|
|
12
12
|
|
13
13
|
def link!(options = {})
|
14
14
|
link = post(options.merge(:connection => :links))
|
15
|
-
Link.new(link
|
15
|
+
Link.new(link[:id], options.merge(link).merge(
|
16
16
|
:access_token => options[:access_token] || self.access_token
|
17
17
|
))
|
18
18
|
end
|
@@ -4,7 +4,7 @@ module FbGraph
|
|
4
4
|
def maybe(options = {})
|
5
5
|
members = self.connection(:maybe, options)
|
6
6
|
members.map! do |member|
|
7
|
-
User.new(member
|
7
|
+
User.new(member[:id], member.merge(
|
8
8
|
:access_token => options[:access_token] || self.access_token
|
9
9
|
))
|
10
10
|
end
|
@@ -4,7 +4,7 @@ module FbGraph
|
|
4
4
|
def members(options = {})
|
5
5
|
members = self.connection(:members, options)
|
6
6
|
members.map! do |member|
|
7
|
-
User.new(member
|
7
|
+
User.new(member[:id], member.merge(
|
8
8
|
:access_token => options[:access_token] || self.access_token
|
9
9
|
))
|
10
10
|
end
|
@@ -4,7 +4,7 @@ module FbGraph
|
|
4
4
|
def music(options = {})
|
5
5
|
music = self.connection(:music, options)
|
6
6
|
music.map! do |_music_|
|
7
|
-
Page.new(_music_
|
7
|
+
Page.new(_music_[:id], _music_.merge(
|
8
8
|
:access_token => options[:access_token] || self.access_token
|
9
9
|
))
|
10
10
|
end
|
@@ -4,7 +4,7 @@ module FbGraph
|
|
4
4
|
def noreply(options = {})
|
5
5
|
members = self.connection(:noreply, options)
|
6
6
|
members.map! do |member|
|
7
|
-
User.new(member
|
7
|
+
User.new(member[:id], member.merge(
|
8
8
|
:access_token => options[:access_token] || self.access_token
|
9
9
|
))
|
10
10
|
end
|
@@ -4,7 +4,7 @@ module FbGraph
|
|
4
4
|
def notes(options = {})
|
5
5
|
notes = self.connection(:notes, options)
|
6
6
|
notes.map! do |note|
|
7
|
-
Note.new(note
|
7
|
+
Note.new(note[:id], note.merge(
|
8
8
|
:access_token => options[:access_token] || self.access_token
|
9
9
|
))
|
10
10
|
end
|
@@ -12,7 +12,7 @@ module FbGraph
|
|
12
12
|
|
13
13
|
def note!(options = {})
|
14
14
|
note = post(options.merge(:connection => :notes))
|
15
|
-
Note.new(note
|
15
|
+
Note.new(note[:id], options.merge(note).merge(
|
16
16
|
:access_token => options[:access_token] || self.access_token
|
17
17
|
))
|
18
18
|
end
|
@@ -4,7 +4,7 @@ module FbGraph
|
|
4
4
|
def photos(options = {})
|
5
5
|
photos = self.connection(:photos, options)
|
6
6
|
photos.map! do |photo|
|
7
|
-
Photo.new(photo
|
7
|
+
Photo.new(photo[:id], photo.merge(
|
8
8
|
:access_token => options[:access_token] || self.access_token
|
9
9
|
))
|
10
10
|
end
|
@@ -12,7 +12,7 @@ module FbGraph
|
|
12
12
|
|
13
13
|
def photo!(options = {})
|
14
14
|
photo = post(options.merge(:connection => :photos))
|
15
|
-
Photo.new(photo
|
15
|
+
Photo.new(photo[:id], options.merge(photo).merge(
|
16
16
|
:access_token => options[:access_token] || self.access_token
|
17
17
|
))
|
18
18
|
end
|
@@ -4,7 +4,7 @@ module FbGraph
|
|
4
4
|
def statuses(options = {})
|
5
5
|
statuses = self.connection(:statuses, options)
|
6
6
|
statuses.map! do |status|
|
7
|
-
Status.new(status
|
7
|
+
Status.new(status[:id], status.merge(
|
8
8
|
:access_token => options[:access_token] || self.access_token
|
9
9
|
))
|
10
10
|
end
|
@@ -4,7 +4,7 @@ module FbGraph
|
|
4
4
|
def television(options = {})
|
5
5
|
television = self.connection(:television, options)
|
6
6
|
television.map! do |_television_|
|
7
|
-
Page.new(_television_
|
7
|
+
Page.new(_television_[:id], _television_.merge(
|
8
8
|
:access_token => options[:access_token] || self.access_token
|
9
9
|
))
|
10
10
|
end
|
@@ -5,14 +5,14 @@ module FbGraph
|
|
5
5
|
options[:access_token] ||= self.access_token || get_access_token(options[:secret])
|
6
6
|
test_users = self.connection(:accounts, options.merge(:connection_scope => 'test-users'))
|
7
7
|
test_users.map! do |test_user|
|
8
|
-
TestUser.new(test_user
|
8
|
+
TestUser.new(test_user[:id], test_user)
|
9
9
|
end
|
10
10
|
end
|
11
11
|
|
12
12
|
def test_user!(options = {})
|
13
13
|
options[:access_token] ||= self.access_token || get_access_token(options[:secret])
|
14
14
|
test_user = post(options.merge(:connection => :accounts, :connection_scope => 'test-users'))
|
15
|
-
TestUser.new(test_user
|
15
|
+
TestUser.new(test_user[:id], test_user)
|
16
16
|
end
|
17
17
|
end
|
18
18
|
end
|
@@ -4,7 +4,7 @@ module FbGraph
|
|
4
4
|
def threads(options = {})
|
5
5
|
threads = self.connection(:threads, options)
|
6
6
|
threads.map! do |thread|
|
7
|
-
Thread.new(thread
|
7
|
+
Thread.new(thread[:id], thread.merge(
|
8
8
|
:access_token => options[:access_token] || self.access_token
|
9
9
|
))
|
10
10
|
end
|
@@ -4,7 +4,7 @@ module FbGraph
|
|
4
4
|
def videos(options = {})
|
5
5
|
videos = self.connection(:videos, options)
|
6
6
|
videos.map! do |video|
|
7
|
-
Video.new(video
|
7
|
+
Video.new(video[:id], video.merge(
|
8
8
|
:access_token => options[:access_token] || self.access_token
|
9
9
|
))
|
10
10
|
end
|
data/lib/fb_graph/education.rb
CHANGED
@@ -6,24 +6,24 @@ module FbGraph
|
|
6
6
|
|
7
7
|
def initialize(attributes = {})
|
8
8
|
if (school = attributes[:school])
|
9
|
-
@school = Page.new(school
|
9
|
+
@school = Page.new(school[:id], school)
|
10
10
|
end
|
11
11
|
if (degree = attributes[:degree])
|
12
|
-
@degree = Page.new(degree
|
12
|
+
@degree = Page.new(degree[:id], degree)
|
13
13
|
end
|
14
14
|
if (year = attributes[:year])
|
15
|
-
@year = Page.new(year
|
15
|
+
@year = Page.new(year[:id], year)
|
16
16
|
end
|
17
17
|
@concentration = []
|
18
18
|
if attributes[:concentration]
|
19
19
|
attributes[:concentration].each do |concentration|
|
20
|
-
@concentration << Page.new(concentration
|
20
|
+
@concentration << Page.new(concentration[:id], concentration)
|
21
21
|
end
|
22
22
|
end
|
23
23
|
@classes = []
|
24
24
|
if attributes[:classes]
|
25
25
|
attributes[:classes].each do |klass|
|
26
|
-
@classes << Klass.new(klass
|
26
|
+
@classes << Klass.new(klass[:id], klass)
|
27
27
|
end
|
28
28
|
end
|
29
29
|
@type = attributes[:type]
|
data/lib/fb_graph/event.rb
CHANGED
@@ -14,7 +14,7 @@ module FbGraph
|
|
14
14
|
def initialize(identifier, attributes = {})
|
15
15
|
super
|
16
16
|
if (owner = attributes[:owner])
|
17
|
-
@owner = User.new(owner
|
17
|
+
@owner = User.new(owner[:id], owner)
|
18
18
|
end
|
19
19
|
@name = attributes[:name]
|
20
20
|
@description = attributes[:description]
|
data/lib/fb_graph/group.rb
CHANGED
@@ -10,7 +10,7 @@ module FbGraph
|
|
10
10
|
def initialize(identifier, attributes = {})
|
11
11
|
super
|
12
12
|
if (owner = attributes[:owner])
|
13
|
-
@owner = User.new(owner
|
13
|
+
@owner = User.new(owner[:id], owner)
|
14
14
|
end
|
15
15
|
@name = attributes[:name]
|
16
16
|
@description = attributes[:description]
|
data/lib/fb_graph/klass.rb
CHANGED
data/lib/fb_graph/link.rb
CHANGED
@@ -9,9 +9,9 @@ module FbGraph
|
|
9
9
|
super
|
10
10
|
if (from = attributes[:from])
|
11
11
|
@from = if from[:category]
|
12
|
-
Page.new(from
|
12
|
+
Page.new(from[:id], from)
|
13
13
|
else
|
14
|
-
User.new(from
|
14
|
+
User.new(from[:id], from)
|
15
15
|
end
|
16
16
|
end
|
17
17
|
@name = attributes[:name]
|
data/lib/fb_graph/message.rb
CHANGED
@@ -11,12 +11,12 @@ module FbGraph
|
|
11
11
|
@subject = attributes[:subject]
|
12
12
|
@message = attributes[:message]
|
13
13
|
if (from = attributes[:from])
|
14
|
-
@from = User.new(from
|
14
|
+
@from = User.new(from[:id], from)
|
15
15
|
end
|
16
16
|
@to = []
|
17
17
|
if attributes[:to]
|
18
18
|
Collection.new(attributes[:to]).each do |to|
|
19
|
-
@to << User.new(to
|
19
|
+
@to << User.new(to[:id], to)
|
20
20
|
end
|
21
21
|
end
|
22
22
|
@tags = []
|
data/lib/fb_graph/node.rb
CHANGED
@@ -13,7 +13,7 @@ module FbGraph
|
|
13
13
|
def fetch(options = {})
|
14
14
|
options[:access_token] ||= self.access_token if self.access_token
|
15
15
|
_fetched_ = get(options)
|
16
|
-
self.class.new(_fetched_
|
16
|
+
self.class.new(_fetched_[:id], _fetched_.merge(:access_token => options[:access_token]))
|
17
17
|
end
|
18
18
|
|
19
19
|
def self.fetch(identifier, options = {})
|
data/lib/fb_graph/note.rb
CHANGED
@@ -9,9 +9,9 @@ module FbGraph
|
|
9
9
|
super
|
10
10
|
if (from = attributes[:from])
|
11
11
|
@from = if from[:category]
|
12
|
-
Page.new(from
|
12
|
+
Page.new(from[:id], from)
|
13
13
|
else
|
14
|
-
User.new(from
|
14
|
+
User.new(from[:id], from)
|
15
15
|
end
|
16
16
|
end
|
17
17
|
@subject = attributes[:subject]
|
data/lib/fb_graph/order.rb
CHANGED
@@ -5,13 +5,13 @@ module FbGraph
|
|
5
5
|
def initialize(identifier, attributes = {})
|
6
6
|
super
|
7
7
|
if application = attributes[:application]
|
8
|
-
@application = Application.new(app
|
8
|
+
@application = Application.new(app[:id], app)
|
9
9
|
end
|
10
10
|
if from = attributes[:from]
|
11
|
-
@from = User.new(from
|
11
|
+
@from = User.new(from[:id], from)
|
12
12
|
end
|
13
13
|
if to = attributes[:to]
|
14
|
-
@to = User.new(to
|
14
|
+
@to = User.new(to[:id], to)
|
15
15
|
end
|
16
16
|
@status = attributes[:status]
|
17
17
|
@country = attributes[:country]
|
data/lib/fb_graph/photo.rb
CHANGED
data/lib/fb_graph/post.rb
CHANGED
@@ -10,25 +10,25 @@ module FbGraph
|
|
10
10
|
super
|
11
11
|
if (from = attributes[:from])
|
12
12
|
@from = if from[:category]
|
13
|
-
Page.new(from
|
13
|
+
Page.new(from[:id], from)
|
14
14
|
else
|
15
|
-
User.new(from
|
15
|
+
User.new(from[:id], from)
|
16
16
|
end
|
17
17
|
end
|
18
18
|
@to = []
|
19
19
|
if attributes[:to]
|
20
20
|
Collection.new(attributes[:to]).each do |to|
|
21
21
|
@to << if to[:category]
|
22
|
-
Page.new(to
|
22
|
+
Page.new(to[:id], to)
|
23
23
|
elsif to[:start_time]
|
24
|
-
Event.new(to
|
24
|
+
Event.new(to[:id], to)
|
25
25
|
elsif to[:version]
|
26
|
-
Group.new(to
|
26
|
+
Group.new(to[:id], to)
|
27
27
|
else
|
28
28
|
if attributes[:context] == Application
|
29
|
-
Application.new(to
|
29
|
+
Application.new(to[:id], to)
|
30
30
|
else
|
31
|
-
User.new(to
|
31
|
+
User.new(to[:id], to)
|
32
32
|
end
|
33
33
|
end
|
34
34
|
end
|
data/lib/fb_graph/searchable.rb
CHANGED
@@ -13,7 +13,7 @@ module FbGraph
|
|
13
13
|
type = self.to_s.underscore.split('/').last
|
14
14
|
Searchable.search(query, options.merge(:type => type, :class => self)) do |collection|
|
15
15
|
collection.map! do |obj|
|
16
|
-
self.new(obj
|
16
|
+
self.new(obj[:id], obj.merge(
|
17
17
|
:access_token => options[:access_token]
|
18
18
|
))
|
19
19
|
end
|
data/lib/fb_graph/status.rb
CHANGED
@@ -9,13 +9,13 @@ module FbGraph
|
|
9
9
|
super
|
10
10
|
if (from = attributes[:from])
|
11
11
|
@from = if from[:category]
|
12
|
-
Page.new(from
|
12
|
+
Page.new(from[:id], from)
|
13
13
|
else
|
14
|
-
User.new(from
|
14
|
+
User.new(from[:id], from)
|
15
15
|
end
|
16
16
|
end
|
17
17
|
@message = attributes[:message]
|
18
|
-
if (updated_time = attributes
|
18
|
+
if (updated_time = attributes[:updated_time])
|
19
19
|
@updated_time = Time.parse(updated_time).utc
|
20
20
|
end
|
21
21
|
|
data/lib/fb_graph/tag.rb
CHANGED
@@ -6,13 +6,13 @@ module FbGraph
|
|
6
6
|
attr_accessor :user, :name, :x, :y, :created_time
|
7
7
|
|
8
8
|
def initialize(attributes = {})
|
9
|
-
@x = attributes
|
10
|
-
@y = attributes
|
11
|
-
if
|
12
|
-
@created_time = Time.parse(created_time).utc
|
9
|
+
@x = attributes[:x]
|
10
|
+
@y = attributes[:y]
|
11
|
+
if attributes[:created_time]
|
12
|
+
@created_time = Time.parse(attributes[:created_time]).utc
|
13
13
|
end
|
14
|
-
if
|
15
|
-
@user = User.new(
|
14
|
+
if attributes[:id].present?
|
15
|
+
@user = User.new(attributes[:id], attributes)
|
16
16
|
end
|
17
17
|
@name = attributes[:name]
|
18
18
|
end
|
data/lib/fb_graph/user.rb
CHANGED
@@ -61,33 +61,33 @@ module FbGraph
|
|
61
61
|
@email = attributes[:email]
|
62
62
|
@website = attributes[:website]
|
63
63
|
if (hometown = attributes[:hometown])
|
64
|
-
@hometown = Page.new(hometown
|
64
|
+
@hometown = Page.new(hometown[:id], hometown)
|
65
65
|
end
|
66
66
|
if (location = attributes[:location])
|
67
|
-
@location = Page.new(location
|
67
|
+
@location = Page.new(location[:id], location)
|
68
68
|
end
|
69
69
|
@sports = []
|
70
70
|
if (sports = attributes[:sports])
|
71
71
|
sports.each do |sport|
|
72
|
-
@sports << Page.new(sport
|
72
|
+
@sports << Page.new(sport[:id], sport)
|
73
73
|
end
|
74
74
|
end
|
75
75
|
@favorite_teams = []
|
76
76
|
if attributes[:favorite_teams]
|
77
77
|
attributes[:favorite_teams].each do |favorite_team|
|
78
|
-
@favorite_teams << Page.new(favorite_team
|
78
|
+
@favorite_teams << Page.new(favorite_team[:id], favorite_team)
|
79
79
|
end
|
80
80
|
end
|
81
81
|
@favorite_athletes = []
|
82
82
|
if attributes[:favorite_athletes]
|
83
83
|
attributes[:favorite_athletes].each do |favorite_athlete|
|
84
|
-
@favorite_athletes << Page.new(favorite_athlete
|
84
|
+
@favorite_athletes << Page.new(favorite_athlete[:id], favorite_athlete)
|
85
85
|
end
|
86
86
|
end
|
87
87
|
@inspirational_people = []
|
88
88
|
if attributes[:inspirational_people]
|
89
89
|
attributes[:inspirational_people].each do |inspirational_person|
|
90
|
-
@inspirational_people << Page.new(inspirational_person
|
90
|
+
@inspirational_people << Page.new(inspirational_person[:id], inspirational_person)
|
91
91
|
end
|
92
92
|
end
|
93
93
|
@bio = attributes[:bio]
|
@@ -101,7 +101,7 @@ module FbGraph
|
|
101
101
|
@political = attributes[:political]
|
102
102
|
@verified = attributes[:verified]
|
103
103
|
if (significant_other = attributes[:significant_other])
|
104
|
-
@significant_other = User.new(significant_other
|
104
|
+
@significant_other = User.new(significant_other[:id], significant_other)
|
105
105
|
end
|
106
106
|
@timezone = attributes[:timezone]
|
107
107
|
@locale = attributes[:locale]
|
@@ -109,7 +109,7 @@ module FbGraph
|
|
109
109
|
@languages = []
|
110
110
|
if attributes[:languages]
|
111
111
|
attributes[:languages].each do |language|
|
112
|
-
@languages << Page.new(language
|
112
|
+
@languages << Page.new(language[:id], language)
|
113
113
|
end
|
114
114
|
end
|
115
115
|
if attributes[:updated_time]
|
data/lib/fb_graph/video.rb
CHANGED
@@ -9,9 +9,9 @@ module FbGraph
|
|
9
9
|
super
|
10
10
|
if (from = attributes[:from])
|
11
11
|
@from = if from[:category]
|
12
|
-
Page.new(from
|
12
|
+
Page.new(from[:id], from)
|
13
13
|
else
|
14
|
-
User.new(from
|
14
|
+
User.new(from[:id], from)
|
15
15
|
end
|
16
16
|
end
|
17
17
|
@message = attributes[:message]
|
data/lib/fb_graph/work.rb
CHANGED
@@ -7,24 +7,24 @@ module FbGraph
|
|
7
7
|
def initialize(attributes = {})
|
8
8
|
@description = attributes[:description]
|
9
9
|
if (employer = attributes[:employer])
|
10
|
-
@employer = Page.new(employer
|
10
|
+
@employer = Page.new(employer[:id], employer)
|
11
11
|
end
|
12
12
|
if (location = attributes[:location])
|
13
|
-
@location = Page.new(location
|
13
|
+
@location = Page.new(location[:id], location)
|
14
14
|
end
|
15
15
|
if (position = attributes[:position])
|
16
|
-
@position = Page.new(position
|
16
|
+
@position = Page.new(position[:id], position)
|
17
17
|
end
|
18
18
|
@projects = []
|
19
19
|
if attributes[:projects]
|
20
20
|
attributes[:projects].each do |project|
|
21
|
-
@projects << Project.new(project
|
21
|
+
@projects << Project.new(project[:id], project)
|
22
22
|
end
|
23
23
|
end
|
24
24
|
@with = []
|
25
25
|
if attributes[:with]
|
26
26
|
attributes[:with].each do |user|
|
27
|
-
@with << User.new(user
|
27
|
+
@with << User.new(user[:id], user)
|
28
28
|
end
|
29
29
|
end
|
30
30
|
if attributes[:start_date] && attributes[:start_date] != '0000-00'
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: fb_graph
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 1.8.
|
5
|
+
version: 1.8.1
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- nov matake
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-05-
|
13
|
+
date: 2011-05-16 00:00:00 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: httpclient
|