Class: Simplerubysteps::State
- Inherits:
-
Object
- Object
- Simplerubysteps::State
- Defined in:
- lib/simplerubysteps/model.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#state_machine ⇒ Object
Returns the value of attribute state_machine.
Instance Method Summary collapse
- #[]=(key, value) ⇒ Object
-
#initialize(name) ⇒ State
constructor
A new instance of State.
- #next=(state) ⇒ Object
- #render ⇒ Object
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
#name ⇒ Object (readonly)
Returns the value of attribute name.
60 61 62 |
# File 'lib/simplerubysteps/model.rb', line 60 def name @name end |
#state_machine ⇒ Object
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 |
#render ⇒ Object
76 77 78 79 80 |
# File 'lib/simplerubysteps/model.rb', line 76 def render dict = @dict dict[:End] = true unless dict[:Next] dict end |