hedwig_wotd v1.0.0 Wotd behaviour View Source

Behaviour to allow mocking of Wotd fetcher.

Link to this section Summary

Callbacks

Hits the wordsmith API for the word of the response

Given a map with a body and status_code of 200, the function returns a four tuple of {:ok, word, description, link}

Link to this section Callbacks

Link to this callback

fetch() View Source
fetch() :: %{body: String.t(), status_code: integer()}

Hits the wordsmith API for the word of the response

Link to this callback

parse(%{}) View Source
parse(%{body: String.t(), status_code: integer()}) ::
  {:ok, String.t(), String.t(), String.t()} | {:error, String.t()}

Given a map with a body and status_code of 200, the function returns a four tuple of {:ok, word, description, link}