Module: Mastodon::REST::Accounts
Instance Method Summary collapse
-
#account(id) ⇒ Mastodon::Account
Retrieve account.
-
#follow_by_uri(uri) ⇒ Mastodon::Account
Follow a remote user.
-
#followers(id) ⇒ Mastodon::Collection<Mastodon::Account>
Get a list of followers.
-
#following(id) ⇒ Mastodon::Collection<Mastodon::Account>
Get a list of followed accounts.
-
#update_credentials(opts = {}) ⇒ Mastodon::Account
Update authenticated account attributes.
-
#verify_credentials ⇒ Mastodon::Account
Retrieve account of authenticated user.
Methods included from Utils
#array_param, #perform_request, #perform_request_with_collection, #perform_request_with_object
Instance Method Details
#account(id) ⇒ Mastodon::Account
Retrieve account
37 38 39 40 |
# File 'lib/mastodon/rest/accounts.rb', line 37 def account(id) perform_request_with_object(:get, "/api/v1/accounts/#{id}", {}, Mastodon::Account) end |
#follow_by_uri(uri) ⇒ Mastodon::Account
Follow a remote user
64 65 66 67 68 |
# File 'lib/mastodon/rest/accounts.rb', line 64 def follow_by_uri(uri) perform_request_with_object(:post, '/api/v1/follows', { uri: uri }, Mastodon::Account) end |
#followers(id) ⇒ Mastodon::Collection<Mastodon::Account>
Get a list of followers
45 46 47 48 49 |
# File 'lib/mastodon/rest/accounts.rb', line 45 def followers(id) perform_request_with_collection(:get, "/api/v1/accounts/#{id}/followers", {}, Mastodon::Account) end |
#following(id) ⇒ Mastodon::Collection<Mastodon::Account>
Get a list of followed accounts
54 55 56 57 58 |
# File 'lib/mastodon/rest/accounts.rb', line 54 def following(id) perform_request_with_collection(:get, "/api/v1/accounts/#{id}/following", {}, Mastodon::Account) end |
#update_credentials(opts = {}) ⇒ Mastodon::Account
Update authenticated account attributes
28 29 30 31 32 |
# File 'lib/mastodon/rest/accounts.rb', line 28 def update_credentials(opts = {}) perform_request_with_object(:patch, '/api/v1/accounts/update_credentials', opts, Mastodon::Account) end |
#verify_credentials ⇒ Mastodon::Account
Retrieve account of authenticated user
13 14 15 16 |
# File 'lib/mastodon/rest/accounts.rb', line 13 def verify_credentials perform_request_with_object(:get, '/api/v1/accounts/verify_credentials', {}, Mastodon::Account) end |