module Mastodon::REST::Relationships
Public Instance Methods
Block a user @param id [Integer] @return [Mastodon::Relationship]
# File lib/mastodon/rest/relationships.rb, line 75 def block(id) perform_request_with_object(:post, "/api/v1/accounts/#{id}/block", {}, Mastodon::Relationship) end
Get a list of blocked accounts @param options [Hash] @option options :max_id [Integer] @option options :since_id [Integer] @option options :min_id [Integer] @option options :limit [Integer] @return [Mastodon::Collection<Mastodon::Account>]
# File lib/mastodon/rest/relationships.rb, line 68 def blocks(options = {}) perform_request_with_collection(:get, '/api/v1/blocks', options, Mastodon::Account) end
Follow a user @param id [Integer] @return [Mastodon::Relationship]
# File lib/mastodon/rest/relationships.rb, line 43 def follow(id) perform_request_with_object(:post, "/api/v1/accounts/#{id}/follow", {}, Mastodon::Relationship) end
Get a list of pending follow requests @param options [Hash] @option options :max_id [Integer] @option options :since_id [Integer] @option options :min_id [Integer] @option options :limit [Integer] @return [Mastodon::Collection<Mastodon::Account>]
# File lib/mastodon/rest/relationships.rb, line 24 def follow_requests(options = {}) perform_request_with_collection(:get, '/api/v1/follow_requests', options, Mastodon::Account) end
Mute a user @param id [Integer] @return [Mastodon::Relationship]
# 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 notifications for a status @param id [Integer] @return [Mastodon::Status]
# 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
Get a list of muted accounts @param options [Hash] @option options :max_id [Integer] @option options :since_id [Integer] @option options :min_id [Integer] @option options :limit [Integer] @return [Mastodon::Collection<Mastodon::Account>]
# File lib/mastodon/rest/relationships.rb, line 93 def mutes(options = {}) perform_request_with_collection(:get, '/api/v1/mutes', options, Mastodon::Account) end
Reject a follow request @param id [Integer]
# File lib/mastodon/rest/relationships.rb, line 36 def reject_follow_request(id) perform_request(:post, "/api/v1/follow_requests/#{id}/reject") end
Get the relationships of authenticated user towards given other users @param ids [Integer] @return [Mastodon::Collection<Mastodon::Relationship>]
# 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
Follow a remote user @param uri [String] username@domain of the person you want to follow @return [Mastodon::Account]
# 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 a user @param id [Integer] @return [Mastodon::Relationship]
# 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 a user @param id [Integer] @return [Mastodon::Relationship]
# 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 a user @param id [Integer] @return [Mastodon::Relationship]
# 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 notifications for a status @param id [Integer] @return [Mastodon::Status]
# 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