View Source Buzzword.Cache (Buzzword Cache v0.1.2)
Buzzword Cache for the Multi-Player Bingo game. The cache is automatically refreshed every hour.
Based on the course Multi-Player Bingo by Mike and Nicole Clark.
Link to this section Summary
Types
A tuple of phrase and points
A map assigning points to phrases
Buzzword phrase
Buzzword points
Functions
Returns a map of buzzwords from the cache.
Refreshes the cache from the configured external file and resets the timer.
Link to this section Types
A tuple of phrase and points
A map assigning points to phrases
@type phrase() :: String.t()
Buzzword phrase
@type points() :: pos_integer()
Buzzword points
Link to this section Functions
@spec get_buzzwords() :: buzzwords()
Returns a map of buzzwords from the cache.
examples
Examples
iex> alias Buzzword.Cache
iex> %{"Low-Hanging Fruit" => points} = Cache.get_buzzwords()
iex> points
300
@spec refresh() :: :refresh
Refreshes the cache from the configured external file and resets the timer.