Sha256: ca639bef74739c3bc9a372a33f850ac3d9d7b534206d09fa2a23e320f32a9346
Contents?: true
Size: 373 Bytes
Versions: 3
Compression:
Stored size: 373 Bytes
Contents
require 'data_mapper/validations/validator' module DataMapper module Validations class StringValidator < Validator def matches(regexp) @regexp = regexp end def errors_for(target) errors = [] errors << Validator::Error.new(@regexp, target) if @regexp && @regexp.match(target) errors end end end end
Version data entries
3 entries across 3 versions & 1 rubygems