Sha256: d0a384990aa13c1e33fc3698124ed075a4f7781972e571622eec09af2d30dc70
Contents?: true
Size: 810 Bytes
Versions: 14
Compression:
Stored size: 810 Bytes
Contents
module Mongoa module MongoMapper module Matchers class ValidateInclusionOfMatcher < ValidateBase def initialize(attribute, within) super(attribute) @within = within end def matches?(subject) super(subject) @validation ? @validation.within == @within : false end def description "require #{@attribute} to be within #{@within}" end def failure_message "Expected #{@attribute} to be within #{@within} but was not" end def negative_failure_message "Expected #{@attribute} to not be within #{@within} but was" end private def validation_type "ValidatesInclusionOf" end end end end end
Version data entries
14 entries across 14 versions & 1 rubygems