Module: ConvenientService::Common::Plugins::CanHaveCallbacks::Concern
- Includes:
- Support::Concern
- Included in:
- Entities::Type
- Defined in:
- lib/convenient_service/common/plugins/can_have_callbacks/concern.rb
Class Method Summary collapse
- .after(method, **kwargs, &block) ⇒ ConvenientService::Common::Plugins::CanHaveCallbacks::Entities::Callback
- .around(method, **kwargs, &block) ⇒ ConvenientService::Common::Plugins::CanHaveCallbacks::Entities::Callback
- .before(method, **kwargs, &block) ⇒ ConvenientService::Common::Plugins::CanHaveCallbacks::Entities::Callback
- .callback(type, method, **kwargs, &block) ⇒ ConvenientService::Common::Plugins::CanHaveCallbacks::Entities::Callback
- .callbacks ⇒ ConvenientService::Common::Plugins::CanHaveCallbacks::Entities::CallbackCollection private
Class Method Details
.after(method, **kwargs, &block) ⇒ ConvenientService::Common::Plugins::CanHaveCallbacks::Entities::Callback
40 41 42 |
# File 'lib/convenient_service/common/plugins/can_have_callbacks/concern.rb', line 40 def after(method, **kwargs, &block) callback(:after, method, **kwargs, &block) end |
.around(method, **kwargs, &block) ⇒ ConvenientService::Common::Plugins::CanHaveCallbacks::Entities::Callback
52 53 54 |
# File 'lib/convenient_service/common/plugins/can_have_callbacks/concern.rb', line 52 def around(method, **kwargs, &block) callback(:around, method, **kwargs, &block) end |
.before(method, **kwargs, &block) ⇒ ConvenientService::Common::Plugins::CanHaveCallbacks::Entities::Callback
28 29 30 |
# File 'lib/convenient_service/common/plugins/can_have_callbacks/concern.rb', line 28 def before(method, **kwargs, &block) callback(:before, method, **kwargs, &block) end |
.callback(type, method, **kwargs, &block) ⇒ ConvenientService::Common::Plugins::CanHaveCallbacks::Entities::Callback
65 66 67 |
# File 'lib/convenient_service/common/plugins/can_have_callbacks/concern.rb', line 65 def callback(type, method, **kwargs, &block) callbacks.create(types: [type, method], block: block, **kwargs) end |
.callbacks ⇒ ConvenientService::Common::Plugins::CanHaveCallbacks::Entities::CallbackCollection
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
16 17 18 |
# File 'lib/convenient_service/common/plugins/can_have_callbacks/concern.rb', line 16 def callbacks internals_class.cache.fetch(:callbacks) { Entities::CallbackCollection.new } end |