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.
40 41 42 43 |
# File 'lib/simplerubysteps/model.rb', line 40 def initialize(name) @name = name @dict = {} end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
37 38 39 |
# File 'lib/simplerubysteps/model.rb', line 37 def name @name end |
#state_machine ⇒ Object
Returns the value of attribute state_machine.
38 39 40 |
# File 'lib/simplerubysteps/model.rb', line 38 def state_machine @state_machine end |
Instance Method Details
#[]=(key, value) ⇒ Object
45 46 47 |
# File 'lib/simplerubysteps/model.rb', line 45 def []=(key, value) @dict[key] = value end |
#next=(state) ⇒ Object
49 50 51 |
# File 'lib/simplerubysteps/model.rb', line 49 def next=(state) @dict[:Next] = (state.is_a? Symbol) ? state : state.name end |
#render ⇒ Object
53 54 55 56 57 |
# File 'lib/simplerubysteps/model.rb', line 53 def render dict = @dict dict[:End] = true unless dict[:Next] dict end |