Class: Morpher::Transform::Hash::Symbolize
- Inherits:
-
Morpher::Transform
- Object
- Morpher::Transform
- Morpher::Transform::Hash::Symbolize
- Defined in:
- lib/morpher/transform.rb
Overview
Transform to symbolize array keys
Instance Method Summary collapse
-
#call(input) ⇒ Hash{Symbol => Object}
Apply transformation to input.
Methods inherited from Morpher::Transform
#array, #maybe, #seq, #slug, #to_proc
Instance Method Details
#call(input) ⇒ Hash{Symbol => Object}
Apply transformation to input
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 |