Class: Saneitized::Hash
- Inherits:
-
SimpleDelegator
- Object
- SimpleDelegator
- Saneitized::Hash
- Defined in:
- lib/saneitized/hash.rb
Instance Method Summary collapse
- #[]=(key, value) ⇒ Object
-
#initialize(hash = {}, options = {}) ⇒ Hash
constructor
A new instance of Hash.
- #merge!(*args, &block) ⇒ Object
Constructor Details
#initialize(hash = {}, options = {}) ⇒ Hash
Returns a new instance of Hash.
7 8 9 10 11 12 13 |
# File 'lib/saneitized/hash.rb', line 7 def initialize(hash = {}, = {}) @options = new_hash = {} hash.each do |key, value| new_hash[key] = Saneitized.convert(value, ) end super(new_hash) self end |
Instance Method Details
#[]=(key, value) ⇒ Object
15 16 17 |
# File 'lib/saneitized/hash.rb', line 15 def []=(key, value) super key, Saneitized.convert(value, @options) end |
#merge!(*args, &block) ⇒ Object
19 20 21 |
# File 'lib/saneitized/hash.rb', line 19 def merge!(*args, &block) raise NotImplementedError end |