Class: Simplerubysteps::State

Inherits:
Object
  • Object
show all
Defined in:
lib/simplerubysteps.rb

Direct Known Subclasses

Callback, Choice, Task

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ State

Returns a new instance of State.



45
46
47
48
# File 'lib/simplerubysteps.rb', line 45

def initialize(name)
  @name = name
  @dict = {}
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



42
43
44
# File 'lib/simplerubysteps.rb', line 42

def name
  @name
end

#state_machineObject

Returns the value of attribute state_machine.



43
44
45
# File 'lib/simplerubysteps.rb', line 43

def state_machine
  @state_machine
end

Instance Method Details

#[]=(key, value) ⇒ Object



50
51
52
# File 'lib/simplerubysteps.rb', line 50

def []=(key, value)
  @dict[key] = value
end

#next=(state) ⇒ Object



54
55
56
# File 'lib/simplerubysteps.rb', line 54

def next=(state)
  @dict[:Next] = (state.is_a? Symbol) ? state : state.name
end

#renderObject



58
59
60
61
62
# File 'lib/simplerubysteps.rb', line 58

def render
  dict = @dict
  dict[:End] = true unless dict[:Next]
  dict
end