Sha256: bfd2896c0c24fc6c28f4f25ca8e15af822173307dffe6a1da5259f440f95e80b
Contents?: true
Size: 482 Bytes
Versions: 40
Compression:
Stored size: 482 Bytes
Contents
module Schemacop module V2 class NumberValidator < Node register symbols: :number, klasses: [Integer, Float] option :min option :max def validate(data, collector) super if option?(:min) && data < option(:min) collector.error "Value must be >= #{option(:min)}." end if option?(:max) && data > option(:max) collector.error "Value must be <= #{option(:max)}." end end end end end
Version data entries
40 entries across 40 versions & 1 rubygems