ecto_fsm v0.2.0 Ecto.FSM.Machine View Source
Provides functions for using FSMs.
Ecto.FSM.Machine.fsm/1
merge fsm from multiple handlers (seeEcto.FSM
to see how to define one).Ecto.FSM.Machine.event_bypasses/1
merge bypasses from multiple handlers (seeEcto.FSM
to see how to define one).Ecto.FSM.Machine.event/2
allows you to execute the correct handler from a state and action
Link to this section Summary
Functions
Returns true if given action is available
Returns available actions
Meta application of the transition function, using find_handler/2
to find the module implementing it
Returns global bypasses
Find bypass
Returns handler for given action, if any
Returns info for particular transition
Returns Ecto.FSM.specs()
built from all handlers
Returns global doc
Link to this section Types
Link to this type
meta_event_error()
View Source
meta_event_error()
View Source
meta_event_error() :: :illegal_action | term()
meta_event_error() :: :illegal_action | term()
Link to this type
meta_event_reply()
View Source
meta_event_reply()
View Source
meta_event_reply() ::
{:ok, Ecto.FSM.Machine.State.t()} | {:error, meta_event_error()}
meta_event_reply() :: {:ok, Ecto.FSM.Machine.State.t()} | {:error, meta_event_error()}
Link to this section Functions
Link to this function
action_available?(state, action)
View Source
action_available?(state, action)
View Source
action_available?(Ecto.FSM.Machine.State.t(), Ecto.FSM.trans()) :: boolean()
action_available?(Ecto.FSM.Machine.State.t(), Ecto.FSM.trans()) :: boolean()
Returns true if given action is available
Link to this function
available_actions(state)
View Source
available_actions(state)
View Source
available_actions(Ecto.FSM.Machine.State.t()) :: [Ecto.FSM.trans()]
available_actions(Ecto.FSM.Machine.State.t()) :: [Ecto.FSM.trans()]
Returns available actions
Link to this function
event(state, arg)
View Source
event(state, arg)
View Source
event(Ecto.FSM.Machine.State.t(), {Ecto.FSM.trans(), term()}) ::
meta_event_reply()
event(Ecto.FSM.Machine.State.t(), {Ecto.FSM.trans(), term()}) :: meta_event_reply()
Meta application of the transition function, using find_handler/2
to find the module implementing it.
Link to this function
event_bypasses(state)
View Source
event_bypasses(state)
View Source
event_bypasses(Ecto.FSM.Machine.State.t()) :: Ecto.FSM.bypasses()
event_bypasses(Ecto.FSM.Machine.State.t()) :: Ecto.FSM.bypasses()
Returns global bypasses
Link to this function
find_bypass_handler(state, trans)
View Source
find_bypass_handler(state, trans)
View Source
find_bypass_handler(Ecto.FSM.Machine.State.t(), Ecto.FSM.trans()) ::
Ecto.FSM.handler() | nil
find_bypass_handler(Ecto.FSM.Machine.State.t(), Ecto.FSM.trans()) :: Ecto.FSM.handler() | nil
Find bypass
Link to this function
find_handler(arg)
View Source
find_handler(arg)
View Source
find_handler({Ecto.FSM.Machine.State.t(), Ecto.FSM.trans()}) ::
Ecto.FSM.handler() | nil
find_handler({Ecto.FSM.Machine.State.t(), Ecto.FSM.trans()}) :: Ecto.FSM.handler() | nil
Returns handler for given action, if any
Link to this function
find_info(state, trans)
View Source
find_info(state, trans)
View Source
find_info(Ecto.FSM.state(), Ecto.FSM.trans()) :: Ecto.FSM.info() | nil
find_info(Ecto.FSM.state(), Ecto.FSM.trans()) :: Ecto.FSM.info() | nil
Returns info for particular transition
Link to this function
fsm(state)
View Source
fsm(state)
View Source
fsm(Ecto.FSM.Machine.State.t()) :: Ecto.FSM.specs()
fsm(Ecto.FSM.Machine.State.t()) :: Ecto.FSM.specs()
Returns Ecto.FSM.specs()
built from all handlers
Link to this function
infos(state, action)
View Source
infos(state, action)
View Source
infos(Ecto.FSM.Machine.State.t(), Ecto.FSM.trans()) :: Ecto.FSM.docs()
infos(Ecto.FSM.Machine.State.t(), Ecto.FSM.trans()) :: Ecto.FSM.docs()
Returns global doc