aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/core_ext/integer
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2007-12-15 02:27:11 +0000
committerJeremy Kemper <jeremy@bitsweat.net>2007-12-15 02:27:11 +0000
commit3d90733e937d11b6905ff11ce006a591ec11b4f4 (patch)
tree4ea501853a55974e9627e30ee2042734a48e3271 /activesupport/lib/active_support/core_ext/integer
parent8d8b573275495648a5bb423198be3575e476cfd1 (diff)
downloadrails-3d90733e937d11b6905ff11ce006a591ec11b4f4.tar.gz
rails-3d90733e937d11b6905ff11ce006a591ec11b4f4.tar.bz2
rails-3d90733e937d11b6905ff11ce006a591ec11b4f4.zip
Ruby 1.9 compat: prefer builtin String#starts_ and ends_with? if available [chuyeow]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8397 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activesupport/lib/active_support/core_ext/integer')
-rw-r--r--activesupport/lib/active_support/core_ext/integer/even_odd.rb8
1 files changed, 4 insertions, 4 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
index 3762308cc3..7ea4cbf2ba 100644
--- a/activesupport/lib/active_support/core_ext/integer/even_odd.rb
+++ b/activesupport/lib/active_support/core_ext/integer/even_odd.rb
@@ -10,14 +10,14 @@ module ActiveSupport #:nodoc:
def multiple_of?(number)
self % number == 0
end
-
+
def even?
multiple_of? 2
- end
-
+ end if RUBY_VERSION < '1.9'
+
def odd?
!even?
- end
+ end if RUBY_VERSION < '1.9'
end
end
end