# `AgentXM.Examples.TinyFlags.BooleanFlag`
[🔗](https://github.com/agentxm/polyglot-examples/blob/main/lib/agentxm_example_tinyflags/boolean_flag.ex#L1)

A feature flag whose treatment is `true` or `false`.

Construct one with `new/1`. Without `:default` the default is `false`. Without
`:rollout` the default value is returned for every caller. With `:rollout`,
the value flips to `not default` for the percentage of callers selected by
deterministic bucketing on the caller `id`.

# `rollout`

```elixir
@type rollout() :: 0..100 | nil
```

An integer rollout percentage in the closed range 0..100.

# `t`

```elixir
@type t() :: %AgentXM.Examples.TinyFlags.BooleanFlag{
  default: boolean(),
  rollout: rollout()
}
```

# `new`

```elixir
@spec new(keyword()) :: {:ok, t()} | {:error, term()}
```

Construct a boolean flag.

Options:

  * `:default` — default value (defaults to `false`).
  * `:rollout` — integer percentage in `0..100`. When set, the value flips
    to `not default` for that share of callers.

# `new!`

```elixir
@spec new!(keyword()) :: t()
```

Like `new/1` but raises `ArgumentError` on invalid input.

---

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