Class: Esse::Hooks::Mixin
- Inherits:
-
Module
- Object
- Module
- Esse::Hooks::Mixin
- Defined in:
- lib/esse/hooks/mixin.rb
Defined Under Namespace
Modules: ClassMethods
Instance Attribute Summary collapse
-
#store_key ⇒ Object
readonly
Returns the value of attribute store_key.
Instance Method Summary collapse
- #included(base) ⇒ Object
-
#initialize(store_key:) ⇒ Mixin
constructor
A new instance of Mixin.
Constructor Details
#initialize(store_key:) ⇒ Mixin
6 7 8 |
# File 'lib/esse/hooks/mixin.rb', line 6 def initialize(store_key:) @store_key = store_key end |
Instance Attribute Details
#store_key ⇒ Object (readonly)
Returns the value of attribute store_key.
4 5 6 |
# File 'lib/esse/hooks/mixin.rb', line 4 def store_key @store_key end |
Instance Method Details
#included(base) ⇒ Object
10 11 12 13 14 |
# File 'lib/esse/hooks/mixin.rb', line 10 def included(base) store_store_key = store_key # closure base.define_singleton_method(:store_key) { store_store_key } base.extend(ClassMethods) end |