Class: Shoulda::Matchers::ActiveModel::NumericalityMatchers::NumericTypeMatcher

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/shoulda/matchers/active_model/numericality_matchers/numeric_type_matcher.rb

Instance Method Summary collapse

Constructor Details

#initialize(numeric_type_matcher, attribute) ⇒ NumericTypeMatcher

Returns a new instance of NumericTypeMatcher.



26
27
28
29
# 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

Instance Method Details

#allowed_type_adjectiveObject



35
36
37
# File 'lib/shoulda/matchers/active_model/numericality_matchers/numeric_type_matcher.rb', line 35

def allowed_type_adjective
  ''
end

#allowed_type_nameObject



31
32
33
# File 'lib/shoulda/matchers/active_model/numericality_matchers/numeric_type_matcher.rb', line 31

def allowed_type_name
  'number'
end

#diff_to_compareObject

Raises:

  • (NotImplementedError)


39
40
41
# File 'lib/shoulda/matchers/active_model/numericality_matchers/numeric_type_matcher.rb', line 39

def diff_to_compare
  raise NotImplementedError
end