Class: KDecor::DecoratorHash
- Inherits:
-
Hash
- Object
- Hash
- KDecor::DecoratorHash
- Includes:
- ResolveInstance, KLog::Logging
- Defined in:
- lib/k_decor/decorator_hash.rb
Overview
Decorator set will hold a set of instantiated decorators with lookup keys
Instance Method Summary collapse
-
#add(key, decorator) ⇒ Object
Add a keyed decorator to the store.
Methods included from ResolveInstance
Instance Method Details
#add(key, decorator) ⇒ Object
Add a keyed decorator to the store.
12 13 14 15 16 17 18 19 20 |
# File 'lib/k_decor/decorator_hash.rb', line 12 def add(key, decorator) if key?(key) log.warn("Decorator with this key '#{key}' already in the stored") return end self[key] = resolve_decorator_instance(decorator) nil end |