diff options
author | Francesco Rodriguez <lrodriguezsanc@gmail.com> | 2012-05-12 20:48:00 -0500 |
---|---|---|
committer | Francesco Rodriguez <lrodriguezsanc@gmail.com> | 2012-05-12 20:48:00 -0500 |
commit | 2f4696de6c469698a702db1e4a1e595ac5acb0df (patch) | |
tree | 293be776c043f0b5768d90be27509f901ef18969 /activesupport/lib/active_support/core_ext/integer | |
parent | 41e7a2ae40f7a07aa98c64e8a37c226d0d9156ed (diff) | |
download | rails-2f4696de6c469698a702db1e4a1e595ac5acb0df.tar.gz rails-2f4696de6c469698a702db1e4a1e595ac5acb0df.tar.bz2 rails-2f4696de6c469698a702db1e4a1e595ac5acb0df.zip |
adding examples and docs
Diffstat (limited to 'activesupport/lib/active_support/core_ext/integer')
-rw-r--r-- | activesupport/lib/active_support/core_ext/integer/multiple.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/activesupport/lib/active_support/core_ext/integer/multiple.rb b/activesupport/lib/active_support/core_ext/integer/multiple.rb index 8dff217ddc..7c6c2f1ca7 100644 --- a/activesupport/lib/active_support/core_ext/integer/multiple.rb +++ b/activesupport/lib/active_support/core_ext/integer/multiple.rb @@ -1,5 +1,9 @@ class Integer # 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 def multiple_of?(number) number != 0 ? self % number == 0 : zero? end |