Module: Esse::Hooks
- Defined in:
- lib/esse/hooks.rb,
lib/esse/hooks/version.rb
Overview
Esse::Hooks is a module that extends Esse with hooks capabilities.
Defined Under Namespace
Modules: Primitives Classes: Mixin
Constant Summary collapse
- VERSION =
"0.0.1"- @@hooks =
{}.freeze
Class Method Summary collapse
-
.[](store_key:) ⇒ Object
Register a hook.
-
.hooks ⇒ Hash{Symbol => Module}
Global variable with list of hooks.
Class Method Details
.[](store_key:) ⇒ Object
Register a hook.
30 31 32 33 34 35 36 |
# File 'lib/esse/hooks.rb', line 30 def [](store_key:) mixin = Mixin.new(store_key: store_key) dup = @@hooks.dup dup[mixin.store_key] = mixin @@hooks = dup.freeze mixin end |
.hooks ⇒ Hash{Symbol => Module}
Global variable with list of hooks.
22 23 24 |
# File 'lib/esse/hooks.rb', line 22 def hooks @@hooks end |