Class: ComposableStateMachine::DefaultCallbackRunner

Inherits:
Object
  • Object
show all
Defined in:
lib/composable_state_machine/default_callback_runner.rb

Overview

Default callback runner that executes callbacks in their current binding.

Class Method Summary collapse

Class Method Details

.run_state_machine_callback(callback, *args) ⇒ Object

Runs a callback in its current binding.

Parameters:

  • callback (Proc, Method, ...)

    the callback, which must respond to #call.

  • args (Array<Object>)

    parameters to pass to the callback.

Returns:

  • (Object)

    the result of the callback



11
12
13
# File 'lib/composable_state_machine/default_callback_runner.rb', line 11

def self.run_state_machine_callback(callback, *args)
  callback.call(*args)
end