Class: API::Validations::Types::HashOfIntegerValues

Inherits:
Object
  • Object
show all
Defined in:
lib/api/validations/types/hash_of_integer_values.rb

Class Method Summary collapse

Class Method Details

.coerceObject


7
8
9
10
11
12
13
14
15
16
# File 'lib/api/validations/types/hash_of_integer_values.rb', line 7

def self.coerce
  lambda do |value|
    case value
    when Hash
      value.transform_values(&:to_i)
    else
      value
    end
  end
end