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

Version Path
ish_lib_manager-0.0.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/shoulda-matchers-2.8.0/lib/shoulda/matchers/active_model/numericality_matchers/only_integer_matcher.rb
shoulda-matchers-3.0.0.rc1 lib/shoulda/matchers/active_model/numericality_matchers/only_integer_matcher.rb
shoulda-matchers-2.8.0 lib/shoulda/matchers/active_model/numericality_matchers/only_integer_matcher.rb
shoulda-matchers-2.8.0.rc2 lib/shoulda/matchers/active_model/numericality_matchers/only_integer_matcher.rb
shoulda-matchers-2.8.0.rc1 lib/shoulda/matchers/active_model/numericality_matchers/only_integer_matcher.rb
shoulda-matchers-2.7.0 lib/shoulda/matchers/active_model/numericality_matchers/only_integer_matcher.rb
shoulda-matchers-2.6.2 lib/shoulda/matchers/active_model/numericality_matchers/only_integer_matcher.rb