class Shoulda::Matchers::ActiveModel::NumericalityMatchers::NumericTypeMatcher
@private
Attributes
Public Class Methods
Source
# File lib/shoulda/matchers/active_model/numericality_matchers/numeric_type_matcher.rb, line 26 def initialize(numeric_type_matcher, attribute) @numeric_type_matcher = numeric_type_matcher @attribute = attribute end
Public Instance Methods
Source
# File lib/shoulda/matchers/active_model/numericality_matchers/numeric_type_matcher.rb, line 35 def allowed_type_adjective '' end
Source
# File lib/shoulda/matchers/active_model/numericality_matchers/numeric_type_matcher.rb, line 31 def allowed_type_name 'number' end
Source
# File lib/shoulda/matchers/active_model/numericality_matchers/numeric_type_matcher.rb, line 39 def diff_to_compare raise NotImplementedError end
Protected Instance Methods
Source
# File lib/shoulda/matchers/active_model/numericality_matchers/numeric_type_matcher.rb, line 51 def disallowed_value raise NotImplementedError end
Source
# File lib/shoulda/matchers/active_model/numericality_matchers/numeric_type_matcher.rb, line 47 def wrap_disallow_value_matcher(_matcher) raise NotImplementedError end
Private Instance Methods
Source
# File lib/shoulda/matchers/active_model/numericality_matchers/numeric_type_matcher.rb, line 57 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