# `Otera.Namespace`
[🔗](https://github.com/georgeguimaraes/otera/blob/v0.1.0/lib/otera/namespace.ex#L1)

A `namespace()` object of Jinja2, which a template can change.

`{% set ns.count = ns.count + 1 %}` changes the namespace everywhere it is referenced, also from inside a loop or a macro. The attributes live in `Otera.State`.

# `t`

```elixir
@type t() :: %Otera.Namespace{ref: reference()}
```

# `attributes`

```elixir
@spec attributes(t()) :: Otera.Dict.t()
```

Returns the attributes of `namespace` as a dict.

# `fetch`

```elixir
@spec fetch(t(), String.t()) :: {:ok, term()} | :error
```

Returns `{:ok, value}` for the attribute `name`, or `:error`.

# `get`

```elixir
@spec get(t(), String.t()) :: term()
```

Returns the attribute `name`, or an undefined value.

# `new`

```elixir
@spec new(Otera.Dict.t()) :: t()
```

Makes a namespace with the attributes of `dict`.

# `put`

```elixir
@spec put(t(), String.t(), term()) :: :ok
```

Sets the attribute `name` to `value`.

---

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