Class: LifecycleVM::State
- Inherits:
-
Object
- Object
- LifecycleVM::State
- Defined in:
- lib/lifecycle_vm/state.rb
Overview
Represents a state in the lifecycle. A state may optionally define a single operation to perform, and then must define which state to transition to next. Transitions may be conditional, controlled by a subclass of LifecycleVM::CondBase
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#op ⇒ Object
readonly
Returns the value of attribute op.
-
#then ⇒ Object
readonly
Returns the value of attribute then.
Instance Method Summary collapse
-
#initialize(name, options) ⇒ State
constructor
A new instance of State.
Constructor Details
#initialize(name, options) ⇒ State
Returns a new instance of State.
30 31 32 33 34 |
# File 'lib/lifecycle_vm/state.rb', line 30 def initialize(name, ) @name = name @op = [:do] @then = Then.new([:then]) if .key?(:then) end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
28 29 30 |
# File 'lib/lifecycle_vm/state.rb', line 28 def name @name end |
#op ⇒ Object (readonly)
Returns the value of attribute op.
28 29 30 |
# File 'lib/lifecycle_vm/state.rb', line 28 def op @op end |
#then ⇒ Object (readonly)
Returns the value of attribute then.
28 29 30 |
# File 'lib/lifecycle_vm/state.rb', line 28 def then @then end |