Sha256: 1db5d93d132dae29617007e2512fddf1b15b62b49bbbb961ed691f63c80ead92
Contents?: true
Size: 629 Bytes
Versions: 4
Compression:
Stored size: 629 Bytes
Contents
module Shoulda # :nodoc: module Matchers module ActiveModel # :nodoc: module NumericalityMatchers class OddNumberMatcher < NumericTypeMatcher # :nodoc: NON_ODD_NUMBER_VALUE = 2 def initialize(attribute, options = {}) @attribute = attribute @disallow_value_matcher = DisallowValueMatcher.new(NON_ODD_NUMBER_VALUE). for(@attribute). with_message(:odd) end def allowed_type 'odd numbers' end def diff_to_compare 2 end end end end end end
Version data entries
4 entries across 4 versions & 1 rubygems