Class: FiniteMachine::EventDefinition Private
- Inherits:
-
Object
- Object
- FiniteMachine::EventDefinition
- Defined in:
- lib/finite_machine/event_definition.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
A class responsible for defining event methods on state machine
Used to add event definitions from TransitionBuilder to the StateMachine to obtain convenience helpers.
Instance Attribute Summary collapse
-
#machine ⇒ Object
readonly
private
The current state machine.
Instance Method Summary collapse
-
#apply(event_name, silent = false) ⇒ nil
Define transition event names as state machine events.
-
#initialize(machine) ⇒ EventDefinition
constructor
private
Initialize an EventDefinition.
Constructor Details
#initialize(machine) ⇒ EventDefinition
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Initialize an EventDefinition
19 20 21 |
# File 'lib/finite_machine/event_definition.rb', line 19 def initialize(machine) @machine = machine end |
Instance Attribute Details
#machine ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
The current state machine
12 13 14 |
# File 'lib/finite_machine/event_definition.rb', line 12 def machine @machine end |
Instance Method Details
#apply(event_name, silent = false) ⇒ nil
Define transition event names as state machine events
31 32 33 34 |
# File 'lib/finite_machine/event_definition.rb', line 31 def apply(event_name, silent = false) define_event_transition(event_name, silent) define_event_bang(event_name, silent) end |