Module: Mastodon::REST::Relationships
Instance Method Summary collapse
-
#block(id) ⇒ Mastodon::Relationship
Block a user.
-
#follow(id) ⇒ Mastodon::Relationship
Follow a user.
-
#relationships(*ids) ⇒ Mastodon::Collection<Mastodon::Relationship>
Get the relationships of authenticated user towards given other users.
-
#unblock(id) ⇒ Mastodon::Relationship
Unblock a user.
-
#unfollow(id) ⇒ Mastodon::Relationship
Unfollow 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
33 34 35 |
# File 'lib/mastodon/rest/relationships.rb', line 33 def block(id) perform_request_with_object(:post, "/api/v1/accounts/#{id}/block", {}, Mastodon::Relationship) end |
#follow(id) ⇒ Mastodon::Relationship
Follow a user
19 20 21 |
# File 'lib/mastodon/rest/relationships.rb', line 19 def follow(id) perform_request_with_object(:post, "/api/v1/accounts/#{id}/follow", {}, Mastodon::Relationship) end |
#relationships(*ids) ⇒ Mastodon::Collection<Mastodon::Relationship>
Get the relationships of authenticated user towards given other users
12 13 14 |
# File 'lib/mastodon/rest/relationships.rb', line 12 def relationships(*ids) perform_request_with_collection(:get, '/api/v1/accounts/relationships', array_param(:id, ids), Mastodon::Relationship) end |
#unblock(id) ⇒ Mastodon::Relationship
Unblock a user
40 41 42 |
# File 'lib/mastodon/rest/relationships.rb', line 40 def unblock(id) perform_request_with_object(:post, "/api/v1/accounts/#{id}/unblock", {}, Mastodon::Relationship) end |
#unfollow(id) ⇒ Mastodon::Relationship
Unfollow a user
26 27 28 |
# File 'lib/mastodon/rest/relationships.rb', line 26 def unfollow(id) perform_request_with_object(:post, "/api/v1/accounts/#{id}/unfollow", {}, Mastodon::Relationship) end |