Class: Wardrobe::AttributeStore

Inherits:
Store
  • Object
show all
Defined in:
lib/wardrobe/attribute_store.rb

Instance Attribute Summary

Attributes inherited from Store

#parent, #store

Instance Method Summary collapse

Methods inherited from Store

#[], #del, #each, #freeze, #initialize, #merge, #method_missing, #values

Constructor Details

This class inherits a constructor from Wardrobe::Store

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Wardrobe::Store

Instance Method Details

#add(name, klass, defining_object, config, **args) ⇒ Object



5
6
7
8
9
10
11
12
13
14
# File 'lib/wardrobe/attribute_store.rb', line 5

def add(name, klass, defining_object, config, **args)
  mutate do
    attribute = Attribute.new(name, klass, defining_object, config, **args)
    if store[name]
      store[name] = store[name].merge(attribute, defining_object, config)
    else
      store[name] = attribute
    end
  end
end