debian-mirror-gitlab/lib/api/validations/types/hash_of_integer_values.rb
2020-08-09 18:53:13 +05:30

21 lines
361 B
Ruby

# frozen_string_literal: true
module API
module Validations
module Types
class HashOfIntegerValues
def self.coerce
lambda do |value|
case value
when Hash
value.transform_values(&:to_i)
else
value
end
end
end
end
end
end
end