We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bf8b992 commit 7d4733aCopy full SHA for 7d4733a
activesupport/lib/active_support/core_ext/integer/multiple.rb
@@ -1,9 +1,9 @@
1
class Integer
2
# Check whether the integer is evenly divisible by the argument.
3
#
4
- # 0.multiple_of?(0) #=> true
5
- # 6.multiple_of?(5) #=> false
6
- # 10.multiple_of?(2) #=> true
+ # 0.multiple_of?(0) # => true
+ # 6.multiple_of?(5) # => false
+ # 10.multiple_of?(2) # => true
7
def multiple_of?(number)
8
number != 0 ? self % number == 0 : zero?
9
end
0 commit comments