Module: Foobara::StateMachine::Callbacks
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_registry ⇒ Object
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_for ⇒ Object
14
15
16
17
18
|
# File 'projects/typesystem/projects/state_machine/src/callbacks.rb', line 14
def callbacks_for(*, **)
callback_registry.callbacks_for(*, **)
end
|
#has_after_callbacks? ⇒ Boolean
32
33
34
35
36
|
# File 'projects/typesystem/projects/state_machine/src/callbacks.rb', line 32
def has_after_callbacks?(*, **)
callback_registry.has_after_callbacks?(*, **)
end
|
#has_around_callbacks? ⇒ Boolean
38
39
40
41
42
|
# File 'projects/typesystem/projects/state_machine/src/callbacks.rb', line 38
def has_around_callbacks?(*, **)
callback_registry.has_around_callbacks?(*, **)
end
|
#has_before_callbacks? ⇒ Boolean
26
27
28
29
30
|
# File 'projects/typesystem/projects/state_machine/src/callbacks.rb', line 26
def has_before_callbacks?(*, **)
callback_registry.has_before_callbacks?(*, **)
end
|
#has_callbacks? ⇒ Boolean
20
21
22
23
24
|
# File 'projects/typesystem/projects/state_machine/src/callbacks.rb', line 20
def has_callbacks?(*, **)
callback_registry.has_callbacks?(*, **)
end
|
#has_error_callbacks? ⇒ Boolean
44
45
46
47
48
|
# File 'projects/typesystem/projects/state_machine/src/callbacks.rb', line 44
def has_error_callbacks?(*, **)
callback_registry.has_error_callbacks?(*, **)
end
|
#initialize ⇒ Object
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
|