Class: LifecycleVM::State

Inherits:
Object
  • Object
show all
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

See Also:

Instance Attribute Summary collapse

Instance Method Summary collapse

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, options)
  @name = name
  @op = options[:do]
  @then = Then.new(options[:then]) if options.key?(:then)
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



28
29
30
# File 'lib/lifecycle_vm/state.rb', line 28

def name
  @name
end

#opObject (readonly)

Returns the value of attribute op.



28
29
30
# File 'lib/lifecycle_vm/state.rb', line 28

def op
  @op
end

#thenObject (readonly)

Returns the value of attribute then.



28
29
30
# File 'lib/lifecycle_vm/state.rb', line 28

def then
  @then
end