Module: Mastodon::REST::Relationships
Instance Method Summary collapse
-
#block(id) ⇒ Mastodon::Relationship
Block a user.
-
#follow(id) ⇒ Mastodon::Relationship
Follow a user.
-
#mute(id) ⇒ Mastodon::Relationship
Mute a user.
-
#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.
Methods included from Utils
#array_param, #perform_request, #perform_request_with_collection, #perform_request_with_object
Instance Method Details
#block(id) ⇒ Mastodon::Relationship
Block a user
47 48 49 50 |
# File 'lib/mastodon/rest/relationships.rb', line 47 def block(id) perform_request_with_object(:post, "/api/v1/accounts/#{id}/block", {}, Mastodon::Relationship) end |
#follow(id) ⇒ Mastodon::Relationship
Follow a user
23 24 25 26 |
# File 'lib/mastodon/rest/relationships.rb', line 23 def follow(id) perform_request_with_object(:post, "/api/v1/accounts/#{id}/follow", {}, Mastodon::Relationship) end |
#mute(id) ⇒ Mastodon::Relationship
Mute a user
63 64 65 66 |
# File 'lib/mastodon/rest/relationships.rb', line 63 def mute(id) perform_request_with_object(:post, "/api/v1/accounts/#{id}/mute", {}, Mastodon::Relationship) end |
#relationships(*ids) ⇒ Mastodon::Collection<Mastodon::Relationship>
Get the relationships of authenticated user towards given other users
14 15 16 17 18 |
# File 'lib/mastodon/rest/relationships.rb', line 14 def relationships(*ids) perform_request_with_collection(:get, '/api/v1/accounts/relationships', array_param(:id, ids), Mastodon::Relationship) end |
#remote_follow(uri) ⇒ Mastodon::Account
Follow a remote user
31 32 33 34 |
# File 'lib/mastodon/rest/relationships.rb', line 31 def remote_follow(uri) perform_request_with_object(:post, '/api/v1/follows', { uri: uri }, Mastodon::Account) end |
#unblock(id) ⇒ Mastodon::Relationship
Unblock a user
55 56 57 58 |
# File 'lib/mastodon/rest/relationships.rb', line 55 def unblock(id) perform_request_with_object(:post, "/api/v1/accounts/#{id}/unblock", {}, Mastodon::Relationship) end |
#unfollow(id) ⇒ Mastodon::Relationship
Unfollow a user
39 40 41 42 |
# File 'lib/mastodon/rest/relationships.rb', line 39 def unfollow(id) perform_request_with_object(:post, "/api/v1/accounts/#{id}/unfollow", {}, Mastodon::Relationship) end |
#unmute(id) ⇒ Mastodon::Relationship
Unmute a user
71 72 73 74 |
# File 'lib/mastodon/rest/relationships.rb', line 71 def unmute(id) perform_request_with_object(:post, "/api/v1/accounts/#{id}/unmute", {}, Mastodon::Relationship) end |