fb_graph 2.2.6 → 2.3.0
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/connections/accounts.rb +3 -3
- data/lib/fb_graph/connections/achievements.rb +2 -2
- data/lib/fb_graph/connections/activities.rb +3 -3
- data/lib/fb_graph/connections/ad_accounts.rb +3 -3
- data/lib/fb_graph/connections/ad_campaign_stats.rb +3 -3
- data/lib/fb_graph/connections/ad_campaigns.rb +6 -6
- data/lib/fb_graph/connections/ad_connection_objects.rb +3 -3
- data/lib/fb_graph/connections/ad_group_stats.rb +3 -3
- data/lib/fb_graph/connections/ad_groups.rb +6 -6
- data/lib/fb_graph/connections/ad_previews.rb +2 -2
- data/lib/fb_graph/connections/albums.rb +6 -6
- data/lib/fb_graph/connections/app_requests.rb +5 -5
- data/lib/fb_graph/connections/attending.rb +4 -4
- data/lib/fb_graph/connections/blocked.rb +1 -1
- data/lib/fb_graph/connections/books.rb +3 -3
- data/lib/fb_graph/connections/broad_targeting_categories.rb +3 -3
- data/lib/fb_graph/connections/checkins.rb +6 -6
- data/lib/fb_graph/connections/comments.rb +6 -6
- data/lib/fb_graph/connections/declined.rb +4 -4
- data/lib/fb_graph/connections/docs.rb +3 -3
- data/lib/fb_graph/connections/events.rb +6 -6
- data/lib/fb_graph/connections/family.rb +3 -3
- data/lib/fb_graph/connections/feed.rb +6 -6
- data/lib/fb_graph/connections/former_participants.rb +3 -3
- data/lib/fb_graph/connections/friend_lists.rb +5 -5
- data/lib/fb_graph/connections/friend_requests.rb +1 -1
- data/lib/fb_graph/connections/friends.rb +3 -3
- data/lib/fb_graph/connections/games.rb +3 -3
- data/lib/fb_graph/connections/groups.rb +3 -3
- data/lib/fb_graph/connections/home.rb +3 -3
- data/lib/fb_graph/connections/inbox.rb +5 -5
- data/lib/fb_graph/connections/insights.rb +7 -3
- data/lib/fb_graph/connections/interests.rb +3 -3
- data/lib/fb_graph/connections/invited.rb +3 -3
- data/lib/fb_graph/connections/likes.rb +5 -5
- data/lib/fb_graph/connections/links.rb +6 -6
- data/lib/fb_graph/connections/maybe.rb +4 -4
- data/lib/fb_graph/connections/members.rb +3 -3
- data/lib/fb_graph/connections/messages.rb +3 -3
- data/lib/fb_graph/connections/movies.rb +3 -3
- data/lib/fb_graph/connections/music.rb +3 -3
- data/lib/fb_graph/connections/mutual_friends.rb +6 -2
- data/lib/fb_graph/connections/noreply.rb +3 -3
- data/lib/fb_graph/connections/notes.rb +6 -6
- data/lib/fb_graph/connections/notifications.rb +14 -0
- data/lib/fb_graph/connections/outbox.rb +5 -5
- data/lib/fb_graph/connections/participants.rb +3 -3
- data/lib/fb_graph/connections/payments.rb +3 -3
- data/lib/fb_graph/connections/photos.rb +6 -6
- data/lib/fb_graph/connections/pokes.rb +2 -2
- data/lib/fb_graph/connections/posts.rb +3 -3
- data/lib/fb_graph/connections/question_options.rb +6 -6
- data/lib/fb_graph/connections/questions.rb +8 -0
- data/lib/fb_graph/connections/reach_estimates.rb +2 -2
- data/lib/fb_graph/connections/reviews.rb +3 -3
- data/lib/fb_graph/connections/senders.rb +3 -3
- data/lib/fb_graph/connections/statuses.rb +3 -3
- data/lib/fb_graph/connections/subscriptions.rb +4 -4
- data/lib/fb_graph/connections/tabs.rb +3 -3
- data/lib/fb_graph/connections/tagged.rb +3 -3
- data/lib/fb_graph/connections/tags.rb +3 -3
- data/lib/fb_graph/connections/television.rb +3 -3
- data/lib/fb_graph/connections/test_users.rb +4 -4
- data/lib/fb_graph/connections/threads.rb +3 -3
- data/lib/fb_graph/connections/user_achievements.rb +2 -2
- data/lib/fb_graph/connections/user_likes.rb +3 -3
- data/lib/fb_graph/connections/videos.rb +6 -6
- data/lib/fb_graph/connections/votes.rb +1 -1
- data/lib/fb_graph/node.rb +1 -2
- data/lib/fb_graph/notification.rb +32 -0
- data/lib/fb_graph/question.rb +3 -1
- data/lib/fb_graph/user.rb +1 -0
- data/lib/fb_graph.rb +1 -0
- data/spec/fb_graph/connections/notifications_spec.rb +16 -0
- data/spec/fb_graph/connections/question_options_spec.rb +1 -1
- data/spec/fb_graph/connections/questions_spec.rb +25 -5
- data/spec/fb_graph/connections/reach_estimates_spec.rb +3 -1
- data/spec/fb_graph/notification_spec.rb +59 -0
- data/spec/mock_json/users/notifications/all.json +407 -0
- data/spec/mock_json/users/questions/created.json +1 -0
- metadata +26 -16
@@ -2,11 +2,11 @@ module FbGraph
|
|
2
2
|
module Connections
|
3
3
|
module Interests
|
4
4
|
def interests(options = {})
|
5
|
-
interests = self.connection
|
5
|
+
interests = self.connection :interests, options
|
6
6
|
interests.map! do |interest|
|
7
|
-
Page.new
|
7
|
+
Page.new interest[:id], interest.merge(
|
8
8
|
:access_token => options[:access_token] || self.access_token
|
9
|
-
)
|
9
|
+
)
|
10
10
|
end
|
11
11
|
end
|
12
12
|
end
|
@@ -2,11 +2,11 @@ module FbGraph
|
|
2
2
|
module Connections
|
3
3
|
module Invited
|
4
4
|
def invited(options = {})
|
5
|
-
members = self.connection
|
5
|
+
members = self.connection :invited, options
|
6
6
|
members.map! do |member|
|
7
|
-
User.new
|
7
|
+
User.new member[:id], member.merge(
|
8
8
|
:access_token => options[:access_token] || self.access_token
|
9
|
-
)
|
9
|
+
)
|
10
10
|
end
|
11
11
|
end
|
12
12
|
end
|
@@ -2,26 +2,26 @@ module FbGraph
|
|
2
2
|
module Connections
|
3
3
|
module Likes
|
4
4
|
def likes(options = {})
|
5
|
-
likes = self.connection
|
5
|
+
likes = self.connection :likes, options
|
6
6
|
likes.map! do |like|
|
7
7
|
like.merge!(
|
8
8
|
:access_token => options[:access_token] || self.access_token
|
9
9
|
)
|
10
10
|
if like[:category]
|
11
|
-
Page.new
|
11
|
+
Page.new like[:id], like
|
12
12
|
else
|
13
|
-
User.new
|
13
|
+
User.new like[:id], like
|
14
14
|
end
|
15
15
|
end
|
16
16
|
end
|
17
17
|
|
18
18
|
module Likable
|
19
19
|
def like!(options = {})
|
20
|
-
post
|
20
|
+
post options.merge(:connection => :likes)
|
21
21
|
end
|
22
22
|
|
23
23
|
def unlike!(options = {})
|
24
|
-
destroy
|
24
|
+
destroy options.merge(:connection => :likes)
|
25
25
|
end
|
26
26
|
end
|
27
27
|
end
|
@@ -2,19 +2,19 @@ module FbGraph
|
|
2
2
|
module Connections
|
3
3
|
module Links
|
4
4
|
def links(options = {})
|
5
|
-
links = self.connection
|
5
|
+
links = self.connection :links, options
|
6
6
|
links.map! do |link|
|
7
|
-
Link.new
|
7
|
+
Link.new link[:id], link.merge(
|
8
8
|
:access_token => options[:access_token] || self.access_token
|
9
|
-
)
|
9
|
+
)
|
10
10
|
end
|
11
11
|
end
|
12
12
|
|
13
13
|
def link!(options = {})
|
14
|
-
link = post
|
15
|
-
Link.new
|
14
|
+
link = post options.merge(:connection => :links)
|
15
|
+
Link.new link[:id], options.merge(link).merge(
|
16
16
|
:access_token => options[:access_token] || self.access_token
|
17
|
-
)
|
17
|
+
)
|
18
18
|
end
|
19
19
|
end
|
20
20
|
end
|
@@ -2,16 +2,16 @@ module FbGraph
|
|
2
2
|
module Connections
|
3
3
|
module Maybe
|
4
4
|
def maybe(options = {})
|
5
|
-
members = self.connection
|
5
|
+
members = self.connection :maybe, options
|
6
6
|
members.map! do |member|
|
7
|
-
User.new
|
7
|
+
User.new member[:id], member.merge(
|
8
8
|
:access_token => options[:access_token] || self.access_token
|
9
|
-
)
|
9
|
+
)
|
10
10
|
end
|
11
11
|
end
|
12
12
|
|
13
13
|
def maybe!(options = {})
|
14
|
-
post
|
14
|
+
post options.merge(:connection => :maybe)
|
15
15
|
end
|
16
16
|
end
|
17
17
|
end
|
@@ -2,11 +2,11 @@ module FbGraph
|
|
2
2
|
module Connections
|
3
3
|
module Members
|
4
4
|
def members(options = {})
|
5
|
-
members = self.connection
|
5
|
+
members = self.connection :members, options
|
6
6
|
members.map! do |member|
|
7
|
-
User.new
|
7
|
+
User.new member[:id], member.merge(
|
8
8
|
:access_token => options[:access_token] || self.access_token
|
9
|
-
)
|
9
|
+
)
|
10
10
|
end
|
11
11
|
end
|
12
12
|
|
@@ -2,11 +2,11 @@ module FbGraph
|
|
2
2
|
module Connections
|
3
3
|
module Messages
|
4
4
|
def messages(options = {})
|
5
|
-
messages = self.connection
|
5
|
+
messages = self.connection :messages, options
|
6
6
|
messages.map! do |message|
|
7
|
-
Message.new
|
7
|
+
Message.new message[:id], message.merge(
|
8
8
|
:access_token => options[:access_token] || self.access_token
|
9
|
-
)
|
9
|
+
)
|
10
10
|
end
|
11
11
|
end
|
12
12
|
end
|
@@ -2,11 +2,11 @@ module FbGraph
|
|
2
2
|
module Connections
|
3
3
|
module Movies
|
4
4
|
def movies(options = {})
|
5
|
-
movies = self.connection
|
5
|
+
movies = self.connection :movies, options
|
6
6
|
movies.map! do |movie|
|
7
|
-
Page.new
|
7
|
+
Page.new movie[:id], movie.merge(
|
8
8
|
:access_token => options[:access_token] || self.access_token
|
9
|
-
)
|
9
|
+
)
|
10
10
|
end
|
11
11
|
end
|
12
12
|
end
|
@@ -2,11 +2,11 @@ module FbGraph
|
|
2
2
|
module Connections
|
3
3
|
module Music
|
4
4
|
def music(options = {})
|
5
|
-
music = self.connection
|
5
|
+
music = self.connection :music, options
|
6
6
|
music.map! do |_music_|
|
7
|
-
Page.new
|
7
|
+
Page.new _music_[:id], _music_.merge(
|
8
8
|
:access_token => options[:access_token] || self.access_token
|
9
|
-
)
|
9
|
+
)
|
10
10
|
end
|
11
11
|
end
|
12
12
|
end
|
@@ -2,9 +2,13 @@ module FbGraph
|
|
2
2
|
module Connections
|
3
3
|
module MutualFriends
|
4
4
|
def mutual_friends(friend, options = {})
|
5
|
-
friends = self.connection
|
5
|
+
friends = self.connection :mutualfriends, options.merge(
|
6
|
+
:connection_scope => connection_scope(friend)
|
7
|
+
)
|
6
8
|
friends.map! do |friend|
|
7
|
-
User.new
|
9
|
+
User.new friend[:id], friend.merge(
|
10
|
+
:access_token => options[:access_token] || self.access_token
|
11
|
+
)
|
8
12
|
end
|
9
13
|
end
|
10
14
|
|
@@ -2,11 +2,11 @@ module FbGraph
|
|
2
2
|
module Connections
|
3
3
|
module Noreply
|
4
4
|
def noreply(options = {})
|
5
|
-
members = self.connection
|
5
|
+
members = self.connection :noreply, options
|
6
6
|
members.map! do |member|
|
7
|
-
User.new
|
7
|
+
User.new member[:id], member.merge(
|
8
8
|
:access_token => options[:access_token] || self.access_token
|
9
|
-
)
|
9
|
+
)
|
10
10
|
end
|
11
11
|
end
|
12
12
|
end
|
@@ -2,19 +2,19 @@ module FbGraph
|
|
2
2
|
module Connections
|
3
3
|
module Notes
|
4
4
|
def notes(options = {})
|
5
|
-
notes = self.connection
|
5
|
+
notes = self.connection :notes, options
|
6
6
|
notes.map! do |note|
|
7
|
-
Note.new
|
7
|
+
Note.new note[:id], note.merge(
|
8
8
|
:access_token => options[:access_token] || self.access_token
|
9
|
-
)
|
9
|
+
)
|
10
10
|
end
|
11
11
|
end
|
12
12
|
|
13
13
|
def note!(options = {})
|
14
|
-
note = post
|
15
|
-
Note.new
|
14
|
+
note = post options.merge(:connection => :notes)
|
15
|
+
Note.new note[:id], options.merge(note).merge(
|
16
16
|
:access_token => options[:access_token] || self.access_token
|
17
|
-
)
|
17
|
+
)
|
18
18
|
end
|
19
19
|
end
|
20
20
|
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
module FbGraph
|
2
|
+
module Connections
|
3
|
+
module Notifications
|
4
|
+
def notifications(options = {})
|
5
|
+
notifications = self.connection :notifications, options
|
6
|
+
notifications.map! do |notification|
|
7
|
+
Notification.new notification[:id], notification.merge(
|
8
|
+
:access_token => options[:access_token] || self.access_token
|
9
|
+
)
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -2,16 +2,16 @@ module FbGraph
|
|
2
2
|
module Connections
|
3
3
|
module Outbox
|
4
4
|
def outbox(options = {})
|
5
|
-
threads = self.connection
|
5
|
+
threads = self.connection :outbox, options
|
6
6
|
threads.map! do |thread|
|
7
7
|
if thread[:message]
|
8
|
-
Thread::BeforeTransition.new
|
8
|
+
Thread::BeforeTransition.new thread[:id], thread.merge(
|
9
9
|
:access_token => options[:access_token] || self.access_token
|
10
|
-
)
|
10
|
+
)
|
11
11
|
else
|
12
|
-
Thread.new
|
12
|
+
Thread.new thread[:id], thread.merge(
|
13
13
|
:access_token => options[:access_token] || self.access_token
|
14
|
-
)
|
14
|
+
)
|
15
15
|
end
|
16
16
|
end
|
17
17
|
end
|
@@ -2,11 +2,11 @@ module FbGraph
|
|
2
2
|
module Connections
|
3
3
|
module Participants
|
4
4
|
def participants(options = {})
|
5
|
-
users = self.connection
|
5
|
+
users = self.connection :participants, options
|
6
6
|
users.map! do |user|
|
7
|
-
User.new
|
7
|
+
User.new user[:id], user.merge(
|
8
8
|
:access_token => options[:access_token] || self.access_token
|
9
|
-
)
|
9
|
+
)
|
10
10
|
end
|
11
11
|
end
|
12
12
|
end
|
@@ -2,11 +2,11 @@ module FbGraph
|
|
2
2
|
module Connections
|
3
3
|
module Payments
|
4
4
|
def payments(options = {})
|
5
|
-
orders = self.connection
|
5
|
+
orders = self.connection :payments, options
|
6
6
|
orders.map! do |order|
|
7
|
-
Order.new
|
7
|
+
Order.new order[:id], order.merge(
|
8
8
|
:access_token => options[:access_token] || self.access_token
|
9
|
-
)
|
9
|
+
)
|
10
10
|
end
|
11
11
|
end
|
12
12
|
end
|
@@ -2,19 +2,19 @@ module FbGraph
|
|
2
2
|
module Connections
|
3
3
|
module Photos
|
4
4
|
def photos(options = {})
|
5
|
-
photos = self.connection
|
5
|
+
photos = self.connection :photos, options
|
6
6
|
photos.map! do |photo|
|
7
|
-
Photo.new
|
7
|
+
Photo.new photo[:id], photo.merge(
|
8
8
|
:access_token => options[:access_token] || self.access_token
|
9
|
-
)
|
9
|
+
)
|
10
10
|
end
|
11
11
|
end
|
12
12
|
|
13
13
|
def photo!(options = {})
|
14
|
-
photo = post
|
15
|
-
Photo.new
|
14
|
+
photo = post options.merge(:connection => :photos)
|
15
|
+
Photo.new photo[:id], options.merge(photo).merge(
|
16
16
|
:access_token => options[:access_token] || self.access_token
|
17
|
-
)
|
17
|
+
)
|
18
18
|
end
|
19
19
|
end
|
20
20
|
end
|
@@ -2,11 +2,11 @@ module FbGraph
|
|
2
2
|
module Connections
|
3
3
|
module Posts
|
4
4
|
def posts(options = {})
|
5
|
-
posts = self.connection
|
5
|
+
posts = self.connection :posts, options
|
6
6
|
posts.map! do |post|
|
7
|
-
Post.new
|
7
|
+
Post.new post[:id], post.merge(
|
8
8
|
:access_token => options[:access_token] || self.access_token
|
9
|
-
)
|
9
|
+
)
|
10
10
|
end
|
11
11
|
end
|
12
12
|
end
|
@@ -1,12 +1,12 @@
|
|
1
1
|
module FbGraph
|
2
2
|
module Connections
|
3
3
|
module QuestionOptions
|
4
|
-
def question_options(
|
5
|
-
question_options = self.connection
|
6
|
-
question_options.map! do |
|
7
|
-
QuestionOption.new
|
8
|
-
:access_token =>
|
9
|
-
)
|
4
|
+
def question_options(options = {})
|
5
|
+
question_options = self.connection :options, options
|
6
|
+
question_options.map! do |question_option|
|
7
|
+
QuestionOption.new question_option[:id], question_option.merge(
|
8
|
+
:access_token => options[:access_token] || self.access_token
|
9
|
+
)
|
10
10
|
end
|
11
11
|
end
|
12
12
|
end
|
@@ -9,6 +9,14 @@ module FbGraph
|
|
9
9
|
)
|
10
10
|
end
|
11
11
|
end
|
12
|
+
|
13
|
+
def question!(options = {})
|
14
|
+
question = post options.merge(:connection => :questions)
|
15
|
+
Question.new question[:id], question.merge(
|
16
|
+
:question => options[:question],
|
17
|
+
:access_token => options[:access_token] || self.access_token
|
18
|
+
)
|
19
|
+
end
|
12
20
|
end
|
13
21
|
end
|
14
22
|
end
|
@@ -2,8 +2,8 @@ module FbGraph
|
|
2
2
|
module Connections
|
3
3
|
module ReachEstimates
|
4
4
|
def reach_estimates(options = {})
|
5
|
-
reach_estimates = self.get
|
6
|
-
ReachEstimate.new
|
5
|
+
reach_estimates = self.get options.merge(:connection => :reachestimate)
|
6
|
+
ReachEstimate.new reach_estimates.merge(:access_token => options[:access_token] || self.access_token)
|
7
7
|
end
|
8
8
|
end
|
9
9
|
end
|
@@ -2,11 +2,11 @@ module FbGraph
|
|
2
2
|
module Connections
|
3
3
|
module Reviews
|
4
4
|
def reviews(options = {})
|
5
|
-
reviews = self.connection
|
5
|
+
reviews = self.connection :reviews, options
|
6
6
|
reviews.map! do |review|
|
7
|
-
Review.new
|
7
|
+
Review.new review[:id], review.merge(
|
8
8
|
:access_token => options[:access_token] || self.access_token
|
9
|
-
)
|
9
|
+
)
|
10
10
|
end
|
11
11
|
end
|
12
12
|
end
|
@@ -2,11 +2,11 @@ module FbGraph
|
|
2
2
|
module Connections
|
3
3
|
module Senders
|
4
4
|
def senders(options = {})
|
5
|
-
users = self.connection
|
5
|
+
users = self.connection :senders, options
|
6
6
|
users.map! do |user|
|
7
|
-
User.new
|
7
|
+
User.new user[:id], user.merge(
|
8
8
|
:access_token => options[:access_token] || self.access_token
|
9
|
-
)
|
9
|
+
)
|
10
10
|
end
|
11
11
|
end
|
12
12
|
end
|
@@ -2,11 +2,11 @@ module FbGraph
|
|
2
2
|
module Connections
|
3
3
|
module Statuses
|
4
4
|
def statuses(options = {})
|
5
|
-
statuses = self.connection
|
5
|
+
statuses = self.connection :statuses, options
|
6
6
|
statuses.map! do |status|
|
7
|
-
Status.new
|
7
|
+
Status.new status[:id], status.merge(
|
8
8
|
:access_token => options[:access_token] || self.access_token
|
9
|
-
)
|
9
|
+
)
|
10
10
|
end
|
11
11
|
end
|
12
12
|
end
|
@@ -8,9 +8,9 @@ module FbGraph
|
|
8
8
|
# => Array of FbGraph::Subscriptions
|
9
9
|
def subscriptions(options = {})
|
10
10
|
options[:access_token] ||= self.access_token
|
11
|
-
subscriptions = self.connection
|
11
|
+
subscriptions = self.connection :subscriptions, options
|
12
12
|
subscriptions.map! do |subscription|
|
13
|
-
Subscription.new
|
13
|
+
Subscription.new subscription.merge(:access_token => options[:access_token])
|
14
14
|
end
|
15
15
|
end
|
16
16
|
|
@@ -30,7 +30,7 @@ module FbGraph
|
|
30
30
|
# => Array of FbGraph::Subscriptions
|
31
31
|
def subscribe!(options = {})
|
32
32
|
options[:access_token] ||= self.access_token
|
33
|
-
post
|
33
|
+
post options.merge(:connection => :subscriptions)
|
34
34
|
end
|
35
35
|
|
36
36
|
# == Subscribe
|
@@ -46,7 +46,7 @@ module FbGraph
|
|
46
46
|
# => Array of FbGraph::Subscriptions
|
47
47
|
def unsubscribe!(options = {})
|
48
48
|
options[:access_token] ||= self.access_token
|
49
|
-
destroy
|
49
|
+
destroy options.merge(:connection => :subscriptions)
|
50
50
|
end
|
51
51
|
end
|
52
52
|
end
|
@@ -2,11 +2,11 @@ module FbGraph
|
|
2
2
|
module Connections
|
3
3
|
module Tabs
|
4
4
|
def tabs(options = {})
|
5
|
-
tabs = self.connection
|
5
|
+
tabs = self.connection :tabs, options
|
6
6
|
tabs.map! do |tab|
|
7
|
-
Tab.new
|
7
|
+
Tab.new tab[:id], tab.merge(
|
8
8
|
:access_token => options[:access_token] || self.access_token
|
9
|
-
)
|
9
|
+
)
|
10
10
|
end
|
11
11
|
end
|
12
12
|
|
@@ -2,11 +2,11 @@ module FbGraph
|
|
2
2
|
module Connections
|
3
3
|
module Tagged
|
4
4
|
def tagged(options = {})
|
5
|
-
posts = self.connection
|
5
|
+
posts = self.connection :tagged, options
|
6
6
|
posts.map! do |post|
|
7
|
-
Post.new
|
7
|
+
Post.new post[:id], post.merge(
|
8
8
|
:access_token => options[:access_token] || self.access_token
|
9
|
-
)
|
9
|
+
)
|
10
10
|
end
|
11
11
|
end
|
12
12
|
end
|
@@ -2,20 +2,20 @@ module FbGraph
|
|
2
2
|
module Connections
|
3
3
|
module Tags
|
4
4
|
def tags(options = {})
|
5
|
-
tags = self.connection
|
5
|
+
tags = self.connection :tags, options
|
6
6
|
if tags.first.is_a?(Tag)
|
7
7
|
tags
|
8
8
|
else
|
9
9
|
tags.map! do |tag|
|
10
10
|
tag[:access_token] ||= options[:access_token] || self.access_token
|
11
|
-
Tag.new
|
11
|
+
Tag.new tag
|
12
12
|
end
|
13
13
|
end
|
14
14
|
end
|
15
15
|
|
16
16
|
module Taggable
|
17
17
|
def tag!(options = {})
|
18
|
-
post
|
18
|
+
post options.merge(:connection => :tags)
|
19
19
|
end
|
20
20
|
end
|
21
21
|
end
|
@@ -2,11 +2,11 @@ module FbGraph
|
|
2
2
|
module Connections
|
3
3
|
module Television
|
4
4
|
def television(options = {})
|
5
|
-
television = self.connection
|
5
|
+
television = self.connection :television, options
|
6
6
|
television.map! do |_television_|
|
7
|
-
Page.new
|
7
|
+
Page.new _television_[:id], _television_.merge(
|
8
8
|
:access_token => options[:access_token] || self.access_token
|
9
|
-
)
|
9
|
+
)
|
10
10
|
end
|
11
11
|
end
|
12
12
|
end
|
@@ -3,16 +3,16 @@ module FbGraph
|
|
3
3
|
module TestUsers
|
4
4
|
def test_users(options = {})
|
5
5
|
options[:access_token] ||= self.access_token
|
6
|
-
test_users = self.connection
|
6
|
+
test_users = self.connection :accounts, options.merge(:connection_scope => 'test-users')
|
7
7
|
test_users.map! do |test_user|
|
8
|
-
TestUser.new
|
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
|
14
|
-
test_user = post
|
15
|
-
TestUser.new
|
14
|
+
test_user = post options.merge(:connection => :accounts, :connection_scope => 'test-users')
|
15
|
+
TestUser.new test_user[:id], test_user
|
16
16
|
end
|
17
17
|
end
|
18
18
|
end
|
@@ -2,11 +2,11 @@ module FbGraph
|
|
2
2
|
module Connections
|
3
3
|
module Threads
|
4
4
|
def threads(options = {})
|
5
|
-
threads = self.connection
|
5
|
+
threads = self.connection :threads, options
|
6
6
|
threads.map! do |thread|
|
7
|
-
Thread.new
|
7
|
+
Thread.new thread[:id], thread.merge(
|
8
8
|
:access_token => options[:access_token] || self.access_token
|
9
|
-
)
|
9
|
+
)
|
10
10
|
end
|
11
11
|
end
|
12
12
|
end
|
@@ -3,9 +3,9 @@ module FbGraph
|
|
3
3
|
module UserAchievements
|
4
4
|
def achievements(options = {})
|
5
5
|
options[:access_token] ||= self.access_token
|
6
|
-
achievements = self.connection
|
6
|
+
achievements = self.connection :achievements, options
|
7
7
|
achievements.map! do |achievement|
|
8
|
-
UserAchievement.new
|
8
|
+
UserAchievement.new achievement[:id], achievement.merge(:access_token => options[:access_token])
|
9
9
|
end
|
10
10
|
end
|
11
11
|
|
@@ -2,11 +2,11 @@ module FbGraph
|
|
2
2
|
module Connections
|
3
3
|
module UserLikes
|
4
4
|
def likes(options = {})
|
5
|
-
likes = self.connection
|
5
|
+
likes = self.connection :likes, options
|
6
6
|
likes.map! do |like|
|
7
|
-
Page.new
|
7
|
+
Page.new like[:id], like.merge!(
|
8
8
|
:access_token => options[:access_token] || self.access_token
|
9
|
-
)
|
9
|
+
)
|
10
10
|
end
|
11
11
|
end
|
12
12
|
|