Class: StateFu::Executioner
Overview
class that handles executing stuff in the context of your ‘object’
Instance Attribute Summary collapse
-
#object ⇒ Object
readonly
Returns the value of attribute object.
-
#transition ⇒ Object
readonly
Returns the value of attribute transition.
Instance Method Summary collapse
- #evaluate(method_name_or_proc) ⇒ Object
-
#initialize(transition, &block) ⇒ Executioner
constructor
A new instance of Executioner.
Constructor Details
#initialize(transition, &block) ⇒ Executioner
Returns a new instance of Executioner.
10 11 12 13 14 |
# File 'lib/executioner.rb', line 10 def initialize transition, &block @transition = transition @object = transition.object self end |
Instance Attribute Details
#object ⇒ Object (readonly)
Returns the value of attribute object.
8 9 10 |
# File 'lib/executioner.rb', line 8 def object @object end |
#transition ⇒ Object (readonly)
Returns the value of attribute transition.
8 9 10 |
# File 'lib/executioner.rb', line 8 def transition @transition end |
Instance Method Details
#evaluate(method_name_or_proc) ⇒ Object
16 17 18 19 |
# File 'lib/executioner.rb', line 16 def evaluate method_name_or_proc args = [transition, transition.arguments] evaluate_with_arguments(method_name_or_proc, *args) end |