Sha256: 02591ac46d902b3124de5855454bb66160721845a9eb6902b0a58009afaf8085
Contents?: true
Size: 392 Bytes
Versions: 14
Compression:
Stored size: 392 Bytes
Contents
require 'haveapi/client/validator' module HaveAPI::Client class Validators::Length < Validator name :length def valid? len = value.length return len == opts[:equals] if opts[:equals] return len >= opts[:min] if opts[:min] && !opts[:max] return len <= opts[:max] if !opts[:min] && opts[:max] len >= opts[:min] && len <= opts[:max] end end end
Version data entries
14 entries across 14 versions & 1 rubygems