class Shackles::ConnectionSpecification::CacheCoherentHash

Public Class Methods

new(spec) click to toggle source
Calls superclass method
# File lib/shackles/connection_specification.rb, line 6
def initialize(spec)
  @spec = spec
  super
end

Public Instance Methods

[]=(key, value) click to toggle source
Calls superclass method
# File lib/shackles/connection_specification.rb, line 11
def []=(key, value)
  super
  @spec.instance_variable_set(:@current_config, nil)
  @spec.instance_variable_get(:@config)[key] = value
end
delete(key) click to toggle source
Calls superclass method
# File lib/shackles/connection_specification.rb, line 17
def delete(key)
  super
  @spec.instance_variable_set(:@current_config, nil)
  @spec.instance_variable_get(:@config).delete(key)
end
dup() click to toggle source
# File lib/shackles/connection_specification.rb, line 23
def dup
  Hash[self]
end
transform_keys(&block) click to toggle source

in rails 4.2, active support tries to create a copy of the original object's class instead of making a new Hash object, so it fails since initialize expects an argument

# File lib/shackles/connection_specification.rb, line 29
def transform_keys(&block)
  dup.transform_keys(&block)
end