instance method
multiple_of?
Ruby on Rails 4.2.9
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 7
def multiple_of?(number)
number != 0 ? self % number == 0 : zero?
end
Defined in activesupport/lib/active_support/core_ext/integer/multiple.rb line 7
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in Integer