Sha256: 4631d3030705075aa423713216ce3948deb0c238aace672adb6c1ad3c3ac81b8
Contents?: true
Size: 281 Bytes
Versions: 5
Compression:
Stored size: 281 Bytes
Contents
module InputSanitizer class PositiveIntegerConverter < V1::IntegerConverter def call(value) super.tap { |value| raise_error if value <= 0 } end private def raise_error raise ConversionError.new("invalid integer (neagtive or zero)") end end end
Version data entries
5 entries across 5 versions & 1 rubygems