Module: SmartCore::Validator::Utils

Extended by:
Utils
Included in:
Utils
Defined in:
lib/smart_core/validator/utils.rb

Instance Method Summary collapse

Instance Method Details

#deeply_symbolize_freeze(hash) ⇒ Object



6
7
8
9
10
11
12
# File 'lib/smart_core/validator/utils.rb', line 6

def deeply_symbolize_freeze(hash)
  hash.dup.freeze.transform_keys(&:to_sym).transform_values do |value|
    next value.dup.freeze unless value.is_a?(Hash)

    deeply_symbolize_freeze(value)
  end
end