Sha256: be2fc08cf48c5b740c8a9a6b582e1bcb6c72322efbdac2f152c83f3abff04f86
Contents?: true
Size: 414 Bytes
Versions: 10
Compression:
Stored size: 414 Bytes
Contents
require 'hermod/validators/base' module Hermod module Validators # Checks a decimal value has no decimal componant, i.e. it's just a decimal # representation of an integer class WholeUnits < Base private def test(value, attributes) value.blank? || value == value.to_i end def message(value, attributes) "must be in whole units" end end end end
Version data entries
10 entries across 10 versions & 1 rubygems