Class: SimplyStated::State
- Inherits:
-
Object
- Object
- SimplyStated::State
- Defined in:
- lib/simply_stated.rb
Instance Attribute Summary collapse
-
#klass ⇒ Object
Returns the value of attribute klass.
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(name, klass) ⇒ State
constructor
A new instance of State.
- #transitions(&blk) ⇒ Object
- #validations(*args, &blk) ⇒ Object
Constructor Details
#initialize(name, klass) ⇒ State
Returns a new instance of State.
63 |
# File 'lib/simply_stated.rb', line 63 def initialize(name, klass) self.klass, self.name = klass, name end |
Instance Attribute Details
#klass ⇒ Object
Returns the value of attribute klass.
62 63 64 |
# File 'lib/simply_stated.rb', line 62 def klass @klass end |
#name ⇒ Object
Returns the value of attribute name.
62 63 64 |
# File 'lib/simply_stated.rb', line 62 def name @name end |
Instance Method Details
#transitions(&blk) ⇒ Object
64 |
# File 'lib/simply_stated.rb', line 64 def transitions(&blk) klass.transition_from(name, &blk) end |
#validations(*args, &blk) ⇒ Object
65 |
# File 'lib/simply_stated.rb', line 65 def validations(*args, &blk) klass.state_validations(name, *args, &blk) end |