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.



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

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

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



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

def name
  @name
end

#state_machineObject

Returns the value of attribute state_machine.



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

def state_machine
  @state_machine
end

Instance Method Details

#[]=(key, value) ⇒ Object



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

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

#next=(state) ⇒ Object



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

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

#renderObject



76
77
78
79
80
# File 'lib/simplerubysteps/model.rb', line 76

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