Module: Foobara::StateMachine::Callbacks

Includes:
Concern
Included in:
Foobara::StateMachine
Defined in:
foobara-0.0.110/projects/state_machine/src/callbacks.rb

Defined Under Namespace

Modules: ClassMethods

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Concern

foobara_class_methods_module_for, foobara_concern?, included

Instance Attribute Details

#callback_registryObject

Returns the value of attribute callback_registry.



6
7
8
# File 'foobara-0.0.110/projects/state_machine/src/callbacks.rb', line 6

def callback_registry
  @callback_registry
end

Instance Method Details

#initializeObject



8
9
10
# File 'foobara-0.0.110/projects/state_machine/src/callbacks.rb', line 8

def initialize(...)
  self.callback_registry = Callback::Registry::ChainedConditioned.new(self.class.class_callback_registry)
end

#register_transition_callback(type) ⇒ Object



21
22
23
# File 'foobara-0.0.110/projects/state_machine/src/callbacks.rb', line 21

def register_transition_callback(type, **, &)
  callback_registry.register_callback(type, **, &)
end