Class: Simplerubysteps::State

Inherits:
Object
  • Object
show all
Defined in:
lib/simplerubysteps/model.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.



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

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

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



56
57
58
# File 'lib/simplerubysteps/model.rb', line 56

def name
  @name
end

#state_machineObject

Returns the value of attribute state_machine.



57
58
59
# File 'lib/simplerubysteps/model.rb', line 57

def state_machine
  @state_machine
end

Instance Method Details

#[]=(key, value) ⇒ Object



64
65
66
# File 'lib/simplerubysteps/model.rb', line 64

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

#next=(state) ⇒ Object



68
69
70
# File 'lib/simplerubysteps/model.rb', line 68

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

#renderObject



72
73
74
75
76
# File 'lib/simplerubysteps/model.rb', line 72

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