Class: Shoulda::Matchers::ActiveModel::NumericalityMatchers::OnlyIntegerMatcher
- Inherits:
-
NumericTypeMatcher
- Object
- NumericTypeMatcher
- Shoulda::Matchers::ActiveModel::NumericalityMatchers::OnlyIntegerMatcher
show all
- Defined in:
- lib/shoulda/matchers/active_model/numericality_matchers/only_integer_matcher.rb
Constant Summary
collapse
- NON_INTEGER_VALUE =
0.1
Instance Method Summary
collapse
#allowed_type_adjective, #initialize
Instance Method Details
#allowed_type_name ⇒ Object
19
20
21
|
# File 'lib/shoulda/matchers/active_model/numericality_matchers/only_integer_matcher.rb', line 19
def allowed_type_name
'integer'
end
|
#diff_to_compare ⇒ Object
23
24
25
|
# File 'lib/shoulda/matchers/active_model/numericality_matchers/only_integer_matcher.rb', line 23
def diff_to_compare
1
end
|
#simple_description ⇒ Object
9
10
11
12
13
14
15
16
17
|
# File 'lib/shoulda/matchers/active_model/numericality_matchers/only_integer_matcher.rb', line 9
def simple_description
description = ''
if expects_strict?
description << ' strictly'
end
description + "disallow :#{attribute} from being a decimal number"
end
|