Class: Wardrobe::OptionStore

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

Instance Attribute Summary collapse

Attributes inherited from Store

#parent

Instance Method Summary collapse

Methods inherited from Store

#[], #del, #each, #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 Attribute Details

#defaultsObject (readonly)

Returns the value of attribute defaults.



5
6
7
# File 'lib/wardrobe/option_store.rb', line 5

def defaults
  @defaults
end

#storeObject (readonly)

Returns the value of attribute store.



5
6
7
# File 'lib/wardrobe/option_store.rb', line 5

def store
  @store
end

Instance Method Details

#add(name, instance) ⇒ Object



12
13
14
# File 'lib/wardrobe/option_store.rb', line 12

def add(name, instance)
  mutate { store[name] = instance }
end

#freezeObject



7
8
9
10
# File 'lib/wardrobe/option_store.rb', line 7

def freeze
  @defaults = select_defaults
  super
end