class Shoulda::Matchers::ActiveModel::NumericalityMatchers::NumericTypeMatcher

@private

Attributes

attribute[R]

Public Class Methods

new(numeric_type_matcher, attribute) click to toggle source
# File lib/shoulda/matchers/active_model/numericality_matchers/numeric_type_matcher.rb, line 25
def initialize(numeric_type_matcher, attribute)
  @numeric_type_matcher = numeric_type_matcher
  @attribute = attribute
end

Public Instance Methods

allowed_type_adjective() click to toggle source
# File lib/shoulda/matchers/active_model/numericality_matchers/numeric_type_matcher.rb, line 34
def allowed_type_adjective
  ''
end
allowed_type_name() click to toggle source
# File lib/shoulda/matchers/active_model/numericality_matchers/numeric_type_matcher.rb, line 30
def allowed_type_name
  'number'
end
diff_to_compare() click to toggle source
# File lib/shoulda/matchers/active_model/numericality_matchers/numeric_type_matcher.rb, line 38
def diff_to_compare
  raise NotImplementedError
end

Protected Instance Methods

disallowed_value() click to toggle source
# File lib/shoulda/matchers/active_model/numericality_matchers/numeric_type_matcher.rb, line 50
def disallowed_value
  raise NotImplementedError
end
wrap_disallow_value_matcher(matcher) click to toggle source
# File lib/shoulda/matchers/active_model/numericality_matchers/numeric_type_matcher.rb, line 46
def wrap_disallow_value_matcher(matcher)
  raise NotImplementedError
end

Private Instance Methods

disallow_value_matcher() click to toggle source
# File lib/shoulda/matchers/active_model/numericality_matchers/numeric_type_matcher.rb, line 56
def disallow_value_matcher
  @_disallow_value_matcher ||= begin
    DisallowValueMatcher.new(disallowed_value).tap do |matcher|
      matcher.for(attribute)
      wrap_disallow_value_matcher(matcher)
    end
  end
end