Class: Saneitized::Hash

Inherits:
SimpleDelegator
  • Object
show all
Defined in:
lib/saneitized/hash.rb

Instance Method Summary collapse

Constructor Details

#initialize(hash = {}) ⇒ Hash

Returns a new instance of Hash.



5
6
7
8
9
10
# File 'lib/saneitized/hash.rb', line 5

def initialize(hash = {})
  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



12
13
14
# File 'lib/saneitized/hash.rb', line 12

def []=(key, value)
  super key, Saneitized.convert(value)
end

#merge!(*args, &block) ⇒ Object

Raises:

  • (NotImplementedError)


16
17
18
# File 'lib/saneitized/hash.rb', line 16

def merge!(*args, &block)
  raise NotImplementedError
end