Class: Shackles::ConnectionSpecification::CacheCoherentHash

Inherits:
Hash
  • Object
show all
Defined in:
lib/shackles/connection_specification.rb

Instance Method Summary collapse

Constructor Details

#initialize(spec) ⇒ CacheCoherentHash

Returns a new instance of CacheCoherentHash.



6
7
8
9
# File 'lib/shackles/connection_specification.rb', line 6

def initialize(spec)
  @spec = spec
  super
end

Instance Method Details

#[]=(key, value) ⇒ Object



11
12
13
14
# File 'lib/shackles/connection_specification.rb', line 11

def []=(key, value)
  @spec.instance_variable_set(:@current_config, nil)
  @spec.instance_variable_get(:@config)[key] = value
end

#delete(key) ⇒ Object



16
17
18
19
# File 'lib/shackles/connection_specification.rb', line 16

def delete(key)
  @spec.instance_variable_set(:@current_config, nil)
  @spec.instance_variable_get(:@config).delete(key)
end