# `Money.Currency.Store`
[🔗](https://github.com/kipcole9/money/blob/v6.0.0-rc.0/lib/money/currency/store.ex#L1)

Persistent-term-backed store for custom currencies.

Custom currencies are currencies defined at runtime using
`Money.Currency.new/2`. They are stored in `:persistent_term`
for fast concurrent read access.

This module is started as part of the Money application
supervision tree.

# `all`

```elixir
@spec all() :: %{required(atom()) =&gt; Localize.Currency.t()}
```

Returns all custom currencies as a map of `%{currency_code => currency_struct}`.

### Returns

* A map of custom currencies. Returns an empty map if no custom
  currencies have been defined.

# `child_spec`

Returns a specification to start this module under a supervisor.

See `Supervisor`.

# `codes`

```elixir
@spec codes() :: [atom()]
```

Returns a list of all custom currency codes.

### Returns

* A list of atom currency codes.

# `get`

```elixir
@spec get(atom()) :: Localize.Currency.t() | nil
```

Returns the custom currency for the given code, or `nil`.

### Arguments

* `code` is a currency code atom.

### Returns

* A `t:Localize.Currency.t/0` struct or `nil`.

# `put`

```elixir
@spec put(Localize.Currency.t()) ::
  {:ok, Localize.Currency.t()} | {:error, Exception.t()}
```

Stores a custom currency.

### Arguments

* `currency` is a `t:Localize.Currency.t/0` struct.

### Returns

* `{:ok, currency}` on success.

* `{:error, Money.CurrencyNotSavedError.t()}` if the store
  is not running.

# `start_link`

Starts the custom currency store.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
