Get a card related with a status

master
Milton Mazzarri 2017-04-10 21:44:31 -05:00
parent e42e4b1f23
commit 87e3d7bae6
No known key found for this signature in database
GPG Key ID: CF3DE6E356E17F1E
1 changed files with 16 additions and 0 deletions

View File

@ -13,6 +13,8 @@ defmodule Hunter.Card do
* `image` - The image associated with the card, if any
"""
@hunter_api Application.get_env(:hunter, :hunter_api)
@type t :: %__MODULE__{
url: URI.t,
title: String.t,
@ -22,4 +24,18 @@ defmodule Hunter.Card do
@derive [Poison.Encoder]
defstruct [:url, :title, :description, :image]
@doc """
Retrieve a card associated with a status
## Parameters
* `conn` - connection credentials
* `id` - status id
"""
@spec card_by_status(Hunter.Client.t, non_neg_integer) :: Hunter.Card.t
def card_by_status(conn, id) do
@hunter_api.card_by_status(conn, id)
end
end