module Hashie::Extensions::Coercion::InstanceMethods
def []=(key, value)
def []=(key, value) into = self.class.key_coercion(key) || self.class.value_coercion(value) if value && into if into.respond_to?(:coerce) value = into.coerce(value) else value = into.new(value) end end super(key, value) end
def custom_writer(key, value, convert = true)
def custom_writer(key, value, convert = true) self[key] = value end
def replace(other_hash)
def replace(other_hash) (keys - other_hash.keys).each { |key| delete(key) } other_hash.each { |key, value| self[key] = value } self end