Using Types::Params::Integer to convert a String containing a number with a decimal point results in an error. Dry::Types::Coercions::Params.to_int("1.5") = invalid value for Integer(): "1.5" (Dry::Types::CoercionError)
I assumed the converter would act identically to Ruby’s String#to_i and remove any digits after the decimal point. "1.5".to_i = 1
Right now I’m adding a check before performing a call using Types::Params::Integer. If the value is a String, I use .to_i instead. But that feels like terrible hack. Can anyone suggest a better way?