Move `reblogged_by` and `favourited_by` to Account module

master
Milton Mazzarri 2017-06-05 12:56:13 -05:00
parent ac9c143bd7
commit d02c45b595
No known key found for this signature in database
GPG Key ID: CF3DE6E356E17F1E
3 changed files with 45 additions and 45 deletions

View File

@ -451,7 +451,7 @@ defmodule Hunter do
"""
@spec reblogged_by(Hunter.Client.t, non_neg_integer, Keyword.t) :: [Hunter.Account.t]
defdelegate reblogged_by(conn, id, options \\ []), to: Hunter.Status
defdelegate reblogged_by(conn, id, options \\ []), to: Hunter.Account
@doc """
Favorite a status
@ -513,7 +513,7 @@ defmodule Hunter do
"""
@spec favourited_by(Hunter.Client.t, non_neg_integer, Keyword.t) :: [Hunter.Account.t]
defdelegate favourited_by(conn, id, options \\ []), to: Hunter.Status
defdelegate favourited_by(conn, id, options \\ []), to: Hunter.Account
@doc """
Get a list of statuses by a user

View File

@ -291,4 +291,47 @@ defmodule Hunter.Account do
def reject_follow_request(conn, id) do
@hunter_api.follow_request_action(conn, id, :reject)
end
@doc """
Fetch the list of users who reblogged the status.
## Parameters
* `conn` - connection credentials
* `id` - status identifier
* `options` - option list
## Options
* `max_id` - get a list of *reblogged by* ids less than or equal this value
* `since_id` - get a list of *reblogged by* ids greater than this value
* `limit` - maximum number of *reblogged by* to get, default: 40, max: 80
"""
@spec reblogged_by(Hunter.Client.t, non_neg_integer, Keyword.t) :: [Hunter.Account.t]
def reblogged_by(conn, id, options \\ []) do
@hunter_api.reblogged_by(conn, id, options)
end
@doc """
Fetch the list of users who favourited the status
## Parameters
* `conn` - connection credentials
* `id` - status identifier
* `options` - option list
## Options
* `max_id` - get a list of *favourited by* ids less than or equal this value
* `since_id` - get a list of *favourited by* ids greater than this value
* `limit` - maximum number of *favourited by* to get, default: 40, max: 80
"""
@spec favourited_by(Hunter.Client.t, non_neg_integer, Keyword.t) :: [Hunter.Account.t]
def favourited_by(conn, id, options \\ []) do
@hunter_api.favourited_by(conn, id, options)
end
end

View File

@ -155,27 +155,6 @@ defmodule Hunter.Status do
@hunter_api.unreblog(conn, id)
end
@doc """
Fetch the list of users who reblogged the status.
## Parameters
* `conn` - connection credentials
* `id` - status identifier
* `options` - option list
## Options
* `max_id` - get a list of *reblogged by* ids less than or equal this value
* `since_id` - get a list of *reblogged by* ids greater than this value
* `limit` - maximum number of *reblogged by* to get, default: 40, max: 80
"""
@spec reblogged_by(Hunter.Client.t, status_id, Keyword.t) :: [Hunter.Account.t]
def reblogged_by(conn, id, options \\ []) do
@hunter_api.reblogged_by(conn, id, options)
end
@doc """
Favorite a status
@ -224,28 +203,6 @@ defmodule Hunter.Status do
@hunter_api.favourites(conn, options)
end
@doc """
Fetch the list of users who favourited the status
## Parameters
* `conn` - connection credentials
* `id` - status identifier
* `options` - option list
## Options
* `max_id` - get a list of *favourited by* ids less than or equal this value
* `since_id` - get a list of *favourited by* ids greater than this value
* `limit` - maximum number of *favourited by* to get, default: 40, max: 80
"""
@spec favourited_by(Hunter.Client.t, status_id, Keyword.t) :: [Hunter.Account.t]
def favourited_by(conn, id, options \\ []) do
@hunter_api.favourited_by(conn, id, options)
end
@doc """
Get a list of statuses by a user