diff options
author | Xavier Noria <fxn@hashref.com> | 2009-11-09 21:46:16 +0100 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2009-11-09 22:16:51 +0100 |
commit | 329e7f44417c00a8d6fee337c288a463e9d64346 (patch) | |
tree | 0fb81a154cad7a0315aa046b25d01cbfebef8376 /activesupport/lib/active_support/core_ext/integer/multiple.rb | |
parent | b6598c683bb8f8ef484f54755cced77a5d6200bb (diff) | |
download | rails-329e7f44417c00a8d6fee337c288a463e9d64346.tar.gz rails-329e7f44417c00a8d6fee337c288a463e9d64346.tar.bz2 rails-329e7f44417c00a8d6fee337c288a463e9d64346.zip |
Integer#even? and Integer#odd? are not needed for Ruby >= 1.8.7
Diffstat (limited to 'activesupport/lib/active_support/core_ext/integer/multiple.rb')
-rw-r--r-- | activesupport/lib/active_support/core_ext/integer/multiple.rb | 6 |
1 files changed, 6 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 new file mode 100644 index 0000000000..40bea54c67 --- /dev/null +++ b/activesupport/lib/active_support/core_ext/integer/multiple.rb @@ -0,0 +1,6 @@ +class Integer + # Check whether the integer is evenly divisible by the argument. + def multiple_of?(number) + self % number == 0 + end +end |