Module: Foobara::StateMachine::Callbacks

Includes:
Concern
Included in:
Foobara::StateMachine
Defined in:
foobara-0.5.8/projects/typesystem/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.



8
9
10
# File 'projects/typesystem/projects/state_machine/src/callbacks.rb', line 8

def callback_registry
  @callback_registry
end

Instance Method Details

#callbacks_forObject



14
15
16
17
18
# File 'projects/typesystem/projects/state_machine/src/callbacks.rb', line 14

def callbacks_for(*, **)
  # :nocov:
  callback_registry.callbacks_for(*, **)
  # :nocov:
end

#has_after_callbacks?Boolean

Returns:

  • (Boolean)


32
33
34
35
36
# File 'projects/typesystem/projects/state_machine/src/callbacks.rb', line 32

def has_after_callbacks?(*, **)
  # :nocov:
  callback_registry.has_after_callbacks?(*, **)
  # :nocov:
end

#has_around_callbacks?Boolean

Returns:

  • (Boolean)


38
39
40
41
42
# File 'projects/typesystem/projects/state_machine/src/callbacks.rb', line 38

def has_around_callbacks?(*, **)
  # :nocov:
  callback_registry.has_around_callbacks?(*, **)
  # :nocov:
end

#has_before_callbacks?Boolean

Returns:

  • (Boolean)


26
27
28
29
30
# File 'projects/typesystem/projects/state_machine/src/callbacks.rb', line 26

def has_before_callbacks?(*, **)
  # :nocov:
  callback_registry.has_before_callbacks?(*, **)
  # :nocov:
end

#has_callbacks?Boolean

Returns:

  • (Boolean)


20
21
22
23
24
# File 'projects/typesystem/projects/state_machine/src/callbacks.rb', line 20

def has_callbacks?(*, **)
  # :nocov:
  callback_registry.has_callbacks?(*, **)
  # :nocov:
end

#has_error_callbacks?Boolean

Returns:

  • (Boolean)


44
45
46
47
48
# File 'projects/typesystem/projects/state_machine/src/callbacks.rb', line 44

def has_error_callbacks?(*, **)
  # :nocov:
  callback_registry.has_error_callbacks?(*, **)
  # :nocov:
end

#initializeObject



10
11
12
# File 'projects/typesystem/projects/state_machine/src/callbacks.rb', line 10

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

#register_transition_callback(type) ⇒ Object



50
51
52
# File 'projects/typesystem/projects/state_machine/src/callbacks.rb', line 50

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