Module: Mastodon::REST::Relationships
Instance Method Summary collapse
-
#authorize_follow_request(id) ⇒ Object
Authorize a follow request.
-
#block(id) ⇒ Mastodon::Relationship
Block a user.
-
#blocks(options = {}) ⇒ Mastodon::Collection<Mastodon::Account>
Get a list of blocked accounts.
-
#follow(id) ⇒ Mastodon::Relationship
Follow a user.
-
#follow_requests(options = {}) ⇒ Mastodon::Collection<Mastodon::Account>
Get a list of pending follow requests.
-
#mute(id) ⇒ Mastodon::Relationship
Mute a user.
-
#mute_status(id) ⇒ Mastodon::Status
Mute notifications for a status.
-
#mutes(options = {}) ⇒ Mastodon::Collection<Mastodon::Account>
Get a list of muted accounts.
-
#reject_follow_request(id) ⇒ Object
Reject a follow request.
-
#relationships(*ids) ⇒ Mastodon::Collection<Mastodon::Relationship>
Get the relationships of authenticated user towards given other users.
-
#remote_follow(uri) ⇒ Mastodon::Account
Follow a remote user.
-
#unblock(id) ⇒ Mastodon::Relationship
Unblock a user.
-
#unfollow(id) ⇒ Mastodon::Relationship
Unfollow a user.
-
#unmute(id) ⇒ Mastodon::Relationship
Unmute a user.
-
#unmute_status(id) ⇒ Mastodon::Status
Unmute notifications for a status.
Methods included from Utils
#array_param, #perform_request, #perform_request_with_collection, #perform_request_with_object
Instance Method Details
#authorize_follow_request(id) ⇒ Object
Authorize a follow request
30 31 32 |
# File 'lib/mastodon/rest/relationships.rb', line 30 def (id) perform_request(:post, "/api/v1/follow_requests/#{id}/authorize") end |
#block(id) ⇒ Mastodon::Relationship
Block a user
75 76 77 |
# File 'lib/mastodon/rest/relationships.rb', line 75 def block(id) perform_request_with_object(:post, "/api/v1/accounts/#{id}/block", {}, Mastodon::Relationship) end |
#blocks(options = {}) ⇒ Mastodon::Collection<Mastodon::Account>
Get a list of blocked accounts
68 69 70 |
# File 'lib/mastodon/rest/relationships.rb', line 68 def blocks( = {}) perform_request_with_collection(:get, '/api/v1/blocks', , Mastodon::Account) end |
#follow(id) ⇒ Mastodon::Relationship
Follow a user
43 44 45 |
# File 'lib/mastodon/rest/relationships.rb', line 43 def follow(id) perform_request_with_object(:post, "/api/v1/accounts/#{id}/follow", {}, Mastodon::Relationship) end |
#follow_requests(options = {}) ⇒ Mastodon::Collection<Mastodon::Account>
Get a list of pending follow requests
24 25 26 |
# File 'lib/mastodon/rest/relationships.rb', line 24 def follow_requests( = {}) perform_request_with_collection(:get, '/api/v1/follow_requests', , Mastodon::Account) end |
#mute(id) ⇒ Mastodon::Relationship
Mute a user
100 101 102 |
# File 'lib/mastodon/rest/relationships.rb', line 100 def mute(id) perform_request_with_object(:post, "/api/v1/accounts/#{id}/mute", {}, Mastodon::Relationship) end |
#mute_status(id) ⇒ Mastodon::Status
Mute notifications for a status
114 115 116 |
# File 'lib/mastodon/rest/relationships.rb', line 114 def mute_status(id) perform_request_with_object(:post, "/api/v1/statuses/#{id}/mute", {}, Mastodon::Status) end |
#mutes(options = {}) ⇒ Mastodon::Collection<Mastodon::Account>
Get a list of muted accounts
93 94 95 |
# File 'lib/mastodon/rest/relationships.rb', line 93 def mutes( = {}) perform_request_with_collection(:get, '/api/v1/mutes', , Mastodon::Account) end |
#reject_follow_request(id) ⇒ Object
Reject a follow request
36 37 38 |
# File 'lib/mastodon/rest/relationships.rb', line 36 def reject_follow_request(id) perform_request(:post, "/api/v1/follow_requests/#{id}/reject") end |
#relationships(*ids) ⇒ Mastodon::Collection<Mastodon::Relationship>
Get the relationships of authenticated user towards given other users
13 14 15 |
# File 'lib/mastodon/rest/relationships.rb', line 13 def relationships(*ids) perform_request_with_collection(:get, '/api/v1/accounts/relationships', { 'id[]': ids }, Mastodon::Relationship) end |
#remote_follow(uri) ⇒ Mastodon::Account
Follow a remote user
50 51 52 |
# File 'lib/mastodon/rest/relationships.rb', line 50 def remote_follow(uri) perform_request_with_object(:post, '/api/v1/follows', { uri: uri }, Mastodon::Account) end |
#unblock(id) ⇒ Mastodon::Relationship
Unblock a user
82 83 84 |
# File 'lib/mastodon/rest/relationships.rb', line 82 def unblock(id) perform_request_with_object(:post, "/api/v1/accounts/#{id}/unblock", {}, Mastodon::Relationship) end |
#unfollow(id) ⇒ Mastodon::Relationship
Unfollow a user
57 58 59 |
# File 'lib/mastodon/rest/relationships.rb', line 57 def unfollow(id) perform_request_with_object(:post, "/api/v1/accounts/#{id}/unfollow", {}, Mastodon::Relationship) end |
#unmute(id) ⇒ Mastodon::Relationship
Unmute a user
107 108 109 |
# File 'lib/mastodon/rest/relationships.rb', line 107 def unmute(id) perform_request_with_object(:post, "/api/v1/accounts/#{id}/unmute", {}, Mastodon::Relationship) end |
#unmute_status(id) ⇒ Mastodon::Status
Unmute notifications for a status
121 122 123 |
# File 'lib/mastodon/rest/relationships.rb', line 121 def unmute_status(id) perform_request_with_object(:post, "/api/v1/statuses/#{id}/unmute", {}, Mastodon::Status) end |