class Shoulda::Matchers::ActiveModel::NumericalityMatchers::OnlyIntegerMatcher

@private

Constants

NON_INTEGER_VALUE

Public Class Methods

new(attribute) click to toggle source
# File lib/shoulda/matchers/active_model/numericality_matchers/only_integer_matcher.rb, line 8
def initialize(attribute)
  @attribute = attribute
  @disallow_value_matcher = DisallowValueMatcher.new(NON_INTEGER_VALUE).
    for(attribute).
    with_message(:not_an_integer)
end

Public Instance Methods

allowed_type() click to toggle source
# File lib/shoulda/matchers/active_model/numericality_matchers/only_integer_matcher.rb, line 15
def allowed_type
  'integers'
end
diff_to_compare() click to toggle source
# File lib/shoulda/matchers/active_model/numericality_matchers/only_integer_matcher.rb, line 19
def diff_to_compare
  1
end