Sha256: 053a8be187217147422f355152567f076baf5f4a7e101bd963a5f17a13aa0ae5
Contents?: true
Size: 436 Bytes
Versions: 14
Compression:
Stored size: 436 Bytes
Contents
module Schemacop 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
Version data entries
14 entries across 14 versions & 1 rubygems