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
45 46 47 |
# File 'lib/convenient_service/common/plugins/can_have_callbacks/concern.rb', line 45 def after(method, **kwargs, &block) callback(:after, method, **kwargs, &block) end |
.around(method, **kwargs, &block) ⇒ ConvenientService::Common::Plugins::CanHaveCallbacks::Entities::Callback
57 58 59 |
# File 'lib/convenient_service/common/plugins/can_have_callbacks/concern.rb', line 57 def around(method, **kwargs, &block) callback(:around, method, **kwargs, &block) end |
.before(method, **kwargs, &block) ⇒ ConvenientService::Common::Plugins::CanHaveCallbacks::Entities::Callback
33 34 35 |
# File 'lib/convenient_service/common/plugins/can_have_callbacks/concern.rb', line 33 def before(method, **kwargs, &block) callback(:before, method, **kwargs, &block) end |
.callback(type, method, **kwargs, &block) ⇒ ConvenientService::Common::Plugins::CanHaveCallbacks::Entities::Callback
70 71 72 |
# File 'lib/convenient_service/common/plugins/can_have_callbacks/concern.rb', line 70 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.
21 22 23 |
# File 'lib/convenient_service/common/plugins/can_have_callbacks/concern.rb', line 21 def callbacks internals_class.cache.fetch(:callbacks) { Entities::CallbackCollection.new } end |