Class: Hey::SanitizedHash

Inherits:
Object
  • Object
show all
Defined in:
lib/hey/sanitized_hash.rb

Instance Method Summary collapse

Constructor Details

#initialize(hash = {}) ⇒ SanitizedHash

Returns a new instance of SanitizedHash.



2
3
4
# File 'lib/hey/sanitized_hash.rb', line 2

def initialize(hash = {})
  @hash = deep_dup(hash)
end

Instance Method Details

#to_hObject



6
7
8
# File 'lib/hey/sanitized_hash.rb', line 6

def to_h
  traverse(hash) { |k, v| [k, sanitize!(v)] }
end