Get status context

master
Milton Mazzarri 2017-04-10 21:46:55 -05:00
parent 74c1d55f72
commit eb86559702
No known key found for this signature in database
GPG Key ID: CF3DE6E356E17F1E
1 changed files with 22 additions and 0 deletions

View File

@ -8,5 +8,27 @@ defmodule Hunter.Context do
* `descendants` - The descendants of the status in the conversation, as a list of Statuses
"""
@hunter_api Application.get_env(:hunter, :hunter_api)
@type t :: %__MODULE__{
ancestors: [Hunter.Status.t],
descendants: [Hunter.Status.t]
}
@derive [Poison.Encoder]
defstruct [:ancestors, :descendants]
@doc """
Retrieve status context
## Parameters
* `conn` - connection credentials
* `id` - status identifier
"""
@spec status_context(Hunter.Client.t, non_neg_integer) :: Hunter.Context.t
def status_context(conn, id) do
@hunter_api.status_context(conn, id)
end
end