module Mastodon::REST::Relationships

Public Instance Methods

block(id) click to toggle source

Block a user @param id [Integer] @return [Mastodon::Relationship]

# 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) click to toggle source

Follow a user @param id [Integer] @return [Mastodon::Relationship]

# 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) click to toggle source

Mute a user @param id [Integer] @return [Mastodon::Relationship]

# 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) click to toggle source

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 14
def relationships(*ids)
  perform_request_with_collection(:get, '/api/v1/accounts/relationships',
                                  array_param(:id, ids),
                                  Mastodon::Relationship)
end
remote_follow(uri) click to toggle source

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 31
def remote_follow(uri)
  perform_request_with_object(:post, '/api/v1/follows', { uri: uri },
                              Mastodon::Account)
end
unblock(id) click to toggle source

Unblock a user @param id [Integer] @return [Mastodon::Relationship]

# 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) click to toggle source

Unfollow a user @param id [Integer] @return [Mastodon::Relationship]

# 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) click to toggle source

Unmute a user @param id [Integer] @return [Mastodon::Relationship]

# File lib/mastodon/rest/relationships.rb, line 71
def unmute(id)
  perform_request_with_object(:post, "/api/v1/accounts/#{id}/unmute",
                              {}, Mastodon::Relationship)
end