Module: Casing::Underscore::Hash

Defined in:
lib/casing/underscore/hash.rb

Class Method Summary collapse

Class Method Details

.call(val, include_values: nil, symbol_to_string: nil) ⇒ Object Also known as: !



4
5
6
7
8
9
# File 'lib/casing/underscore/hash.rb', line 4

def self.call(val, include_values: nil, symbol_to_string: nil)
  include_values = include_values.nil? ? false : include_values
  symbol_to_string ||= false

  ::Hash[val.map { |k, v| [Casing::Underscore.(k, include_values: true, symbol_to_string: symbol_to_string), Casing::Underscore.(v, include_values: include_values, symbol_to_string: symbol_to_string)] }]
end