class Shoulda::Matchers::ActiveModel::NumericalityMatchers::OddNumberMatcher

@private

Constants

NON_ODD_NUMBER_VALUE

Public Class Methods

new(attribute, options = {}) click to toggle source
# File lib/shoulda/matchers/active_model/numericality_matchers/odd_number_matcher.rb, line 9
def initialize(attribute, options = {})
  @attribute = attribute
  @disallow_value_matcher = DisallowValueMatcher.new(NON_ODD_NUMBER_VALUE).
      for(@attribute).
      with_message(:odd)
end

Public Instance Methods

allowed_type() click to toggle source
# File lib/shoulda/matchers/active_model/numericality_matchers/odd_number_matcher.rb, line 16
def allowed_type
  'odd numbers'
end
diff_to_compare() click to toggle source
# File lib/shoulda/matchers/active_model/numericality_matchers/odd_number_matcher.rb, line 20
def diff_to_compare
  2
end