instance method
multiple_of?
Ruby on Rails 8.1.2
Since v3.0.20Signature
multiple_of?(number)
Check whether the integer is evenly divisible by the argument.
0.multiple_of?(0) # => true 6.multiple_of?(5) # => false 10.multiple_of?(2) # => true
Parameters
-
numberreq
Source
# File activesupport/lib/active_support/core_ext/integer/multiple.rb, line 9
def multiple_of?(number)
number == 0 ? self == 0 : self % number == 0
end
Defined in activesupport/lib/active_support/core_ext/integer/multiple.rb line 9
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in Integer