Method: Morpher::Transform::Hash::Symbolize#call

Defined in:
lib/morpher/transform.rb

#call(input) ⇒ Hash{Symbol => Object}

Apply transformation to input

Parameters:

  • (Hash{String => Object})

Returns:

  • (Hash{Symbol => Object})


325
326
327
328
329
330
331
# File 'lib/morpher/transform.rb', line 325

def call(input)
  unless input.keys.all? { |key| key.instance_of?(String) }
    return failure(error(input: input, message: 'Found non string key in input'))
  end

  success(input.transform_keys(&:to_sym))
end