Class: AASM::SupportingClasses::State
- Inherits:
-
Object
- Object
- AASM::SupportingClasses::State
- Defined in:
- lib/state.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
- #entered(record) ⇒ Object
- #entering(record) ⇒ Object
- #exited(record) ⇒ Object
-
#initialize(name, options = {}) ⇒ State
constructor
A new instance of State.
Constructor Details
#initialize(name, options = {}) ⇒ State
Returns a new instance of State.
6 7 8 |
# File 'lib/state.rb', line 6 def initialize(name, ={}) @name, = name, end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
4 5 6 |
# File 'lib/state.rb', line 4 def name @name end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
4 5 6 |
# File 'lib/state.rb', line 4 def end |
Instance Method Details
#entered(record) ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/state.rb', line 15 def entered(record) afteractions = [:after] return unless afteractions Array(afteractions).each do |afteract| record.send(:run_transition_action, afteract) end end |
#entering(record) ⇒ Object
10 11 12 13 |
# File 'lib/state.rb', line 10 def entering(record) enteract = [:enter] record.send(:run_transition_action, enteract) if enteract end |
#exited(record) ⇒ Object
23 24 25 26 |
# File 'lib/state.rb', line 23 def exited(record) exitact = [:exit] record.send(:run_transition_action, exitact) if exitact end |