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
Instance Method Details
#call(input) ⇒ Hash{Symbol => Object}
Apply transformation to input
295 296 297 298 299 300 301 |
# File 'lib/morpher/transform.rb', line 295 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 |