lib/saneitized/hash.rb in saneitized-1.3.0 vs lib/saneitized/hash.rb in saneitized-1.3.1

- old
+ new

@@ -1,17 +1,18 @@ module Saneitized class Hash < SimpleDelegator - def initialize(hash = {}) + def initialize(hash = {}, options = {}) + @options = options new_hash = {} - hash.each do |key, value| new_hash[key] = Saneitized.convert(value) end + hash.each do |key, value| new_hash[key] = Saneitized.convert(value, options) end super(new_hash) self end def []=(key, value) - super key, Saneitized.convert(value) + super key, Saneitized.convert(value, @options) end def merge!(*args, &block) raise NotImplementedError end