stateful_agents v0.1.0 StatefulAgents.BooleanAgent View Source

Link to this section Summary

Functions

iex> alias StatefulAgents.BooleanAgent …> {:ok, pid} = BooleanAgent.start_link …> assert is_pid(pid) true …> value = BooleanAgent.get …> is_boolean(value) true

iex> alias StatefulAgents.BooleanAgent …> {:ok, pid} = BooleanAgent.start_link …> assert is_pid(pid) true …> BooleanAgent.set(true) :ok

Stores a boolean as the Agent’s state. Provides helper functions to access and set state in the Agent

Link to this section Functions

iex> alias StatefulAgents.BooleanAgent …> {:ok, pid} = BooleanAgent.start_link …> assert is_pid(pid) true …> value = BooleanAgent.get …> is_boolean(value) true

iex> alias StatefulAgents.BooleanAgent …> {:ok, pid} = BooleanAgent.start_link …> assert is_pid(pid) true …> BooleanAgent.set(true) :ok

Stores a boolean as the Agent’s state. Provides helper functions to access and set state in the Agent.

iex> alias StatefulAgents.BooleanAgent …> {:ok, pid} = BooleanAgent.start_link …> is_pid(pid) true