class KDecor::DecoratorHash

Decorator set will hold a set of instantiated decorators with lookup keys

Public Instance Methods

add(key, decorator) click to toggle source

Add a keyed decorator to the store.

@param [Symbol] key lookup key that can be used when retrieving the decorator

# 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