View Source Buzzword.Cache (Buzzword Cache v0.1.10)

Buzzword Cache for the Multi-Player Buzzword Bingo game. The cache is automatically refreshed every hour.

Based on the course Multi-Player Bingo by Mike and Nicole Clark.

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.

Types

@type buzzword() :: {phrase(), points()}

A tuple of phrase and points

@type buzzwords() :: %{required(phrase()) => points()}

A map assigning points to phrases

@type phrase() :: String.t()

Buzzword phrase

@type points() :: pos_integer()

Buzzword points

Functions

@spec get_buzzwords() :: buzzwords()

Returns a map of buzzwords from the cache.

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.