Sha256: 24d38d3d93b10092dfeaaab3cc157ff7ef2da184adb59d569a5ca4b9db540ad4
Contents?: true
Size: 622 Bytes
Versions: 10
Compression:
Stored size: 622 Bytes
Contents
module Shoulda module Matchers module ActiveModel module NumericalityMatchers # @private class EvenNumberMatcher < NumericTypeMatcher NON_EVEN_NUMBER_VALUE = 1 def initialize(attribute, options = {}) @attribute = attribute @disallow_value_matcher = DisallowValueMatcher.new(NON_EVEN_NUMBER_VALUE). for(@attribute). with_message(:even) end def allowed_type 'even numbers' end def diff_to_compare 2 end end end end end end
Version data entries
10 entries across 10 versions & 3 rubygems