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.
-
#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
18 19 20 |
# File 'lib/mastodon/rest/accounts.rb', line 18 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
39 40 41 |
# File 'lib/mastodon/rest/accounts.rb', line 39 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
25 26 27 |
# File 'lib/mastodon/rest/accounts.rb', line 25 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
32 33 34 |
# File 'lib/mastodon/rest/accounts.rb', line 32 def following(id) perform_request_with_collection(:get, "/api/v1/accounts/#{id}/following", {}, Mastodon::Account) end |
#verify_credentials ⇒ Mastodon::Account
Retrieve account of authenticated user
11 12 13 |
# File 'lib/mastodon/rest/accounts.rb', line 11 def verify_credentials perform_request_with_object(:get, '/api/v1/accounts/verify_credentials', {}, Mastodon::Account) end |