aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/core_ext/integer/even_odd.rb
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2009-11-09 21:46:16 +0100
committerXavier Noria <fxn@hashref.com>2009-11-09 22:16:51 +0100
commit329e7f44417c00a8d6fee337c288a463e9d64346 (patch)
tree0fb81a154cad7a0315aa046b25d01cbfebef8376 /activesupport/lib/active_support/core_ext/integer/even_odd.rb
parentb6598c683bb8f8ef484f54755cced77a5d6200bb (diff)
downloadrails-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/even_odd.rb')
-rw-r--r--activesupport/lib/active_support/core_ext/integer/even_odd.rb16
1 files changed, 0 insertions, 16 deletions
diff --git a/activesupport/lib/active_support/core_ext/integer/even_odd.rb b/activesupport/lib/active_support/core_ext/integer/even_odd.rb
deleted file mode 100644
index 8f9a97b44c..0000000000
--- a/activesupport/lib/active_support/core_ext/integer/even_odd.rb
+++ /dev/null
@@ -1,16 +0,0 @@
-class Integer
- # Check whether the integer is evenly divisible by the argument.
- def multiple_of?(number)
- self % number == 0
- end
-
- # Is the integer a multiple of 2?
- def even?
- multiple_of? 2
- end unless method_defined?(:even?)
-
- # Is the integer not a multiple of 2?
- def odd?
- !even?
- end unless method_defined?(:odd?)
-end