Module: ComposableStateMachine::CallbackRunner
- Defined in:
- lib/composable_state_machine/callback_runner.rb
Overview
Mixin module that runs callbacks with self pointing to the object the module is included in.
Instance Method Summary collapse
-
#run_state_machine_callback(callback, *args) ⇒ Object
Runs a callback with self pointing to the object the module is included in.
Instance Method Details
#run_state_machine_callback(callback, *args) ⇒ Object
Runs a callback with self pointing to the object the module is included in.
11 12 13 14 15 16 |
# File 'lib/composable_state_machine/callback_runner.rb', line 11 def run_state_machine_callback(callback, *args) if callback.respond_to?(:bind) callback = callback.bind(self) end instance_exec(*args, &callback) end |