Class: Fosm::Lifecycle::StateDefinition
- Inherits:
-
Object
- Object
- Fosm::Lifecycle::StateDefinition
- Defined in:
- lib/fosm/lifecycle/state_definition.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #initial? ⇒ Boolean
-
#initialize(name:, initial: false, terminal: false) ⇒ StateDefinition
constructor
A new instance of StateDefinition.
- #terminal? ⇒ Boolean
- #to_s ⇒ Object
Constructor Details
#initialize(name:, initial: false, terminal: false) ⇒ StateDefinition
Returns a new instance of StateDefinition.
6 7 8 9 10 |
# File 'lib/fosm/lifecycle/state_definition.rb', line 6 def initialize(name:, initial: false, terminal: false) @name = name.to_sym @initial = initial @terminal = terminal end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
4 5 6 |
# File 'lib/fosm/lifecycle/state_definition.rb', line 4 def name @name end |
Instance Method Details
#initial? ⇒ Boolean
12 |
# File 'lib/fosm/lifecycle/state_definition.rb', line 12 def initial? = @initial |
#terminal? ⇒ Boolean
13 |
# File 'lib/fosm/lifecycle/state_definition.rb', line 13 def terminal? = @terminal |
#to_s ⇒ Object
15 |
# File 'lib/fosm/lifecycle/state_definition.rb', line 15 def to_s = @name.to_s |