Sha256: d820ec85b13e5bfc6967b31ab837cb430909869c83122c84a16c97ffe7d01d0c
Contents?: true
Size: 603 Bytes
Versions: 7
Compression:
Stored size: 603 Bytes
Contents
module Shoulda module Matchers module ActiveModel module NumericalityMatchers # @private class OnlyIntegerMatcher < NumericTypeMatcher NON_INTEGER_VALUE = 0.1 def initialize(attribute) @attribute = attribute @disallow_value_matcher = DisallowValueMatcher.new(NON_INTEGER_VALUE). for(attribute). with_message(:not_an_integer) end def allowed_type 'integers' end def diff_to_compare 1 end end end end end end
Version data entries
7 entries across 7 versions & 2 rubygems