aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/core_ext/integer/multiple.rb
blob: 8dff217ddce41bb0586fa301e0a77ea1d5b9bf67 (plain) (blame)
1
2
3
4
5
6
class Integer
  # Check whether the integer is evenly divisible by the argument.
  def multiple_of?(number)
    number != 0 ? self % number == 0 : zero?
  end
end