Class: Hey::SanitizedHash
- Inherits:
-
Object
- Object
- Hey::SanitizedHash
- Defined in:
- lib/hey/sanitized_hash.rb
Instance Method Summary collapse
-
#initialize(hash = {}) ⇒ SanitizedHash
constructor
A new instance of SanitizedHash.
- #to_h ⇒ Object
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_h ⇒ Object
6 7 8 |
# File 'lib/hey/sanitized_hash.rb', line 6 def to_h traverse(hash) { |k, v| [k, sanitize!(v)] } end |