aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/core_ext/integer
diff options
context:
space:
mode:
authorPratik Naik <pratiknaik@gmail.com>2008-05-25 12:29:00 +0100
committerPratik Naik <pratiknaik@gmail.com>2008-05-25 12:29:00 +0100
commit98dc582742779081e71e697fcdf8d9ae2b421b16 (patch)
treef5680eef86e689a10d0f75434ba6a4e94829e439 /activesupport/lib/active_support/core_ext/integer
parent6277fd91133a3566333612857510d74de60d67f4 (diff)
downloadrails-98dc582742779081e71e697fcdf8d9ae2b421b16.tar.gz
rails-98dc582742779081e71e697fcdf8d9ae2b421b16.tar.bz2
rails-98dc582742779081e71e697fcdf8d9ae2b421b16.zip
Merge docrails.
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
Diffstat (limited to 'activesupport/lib/active_support/core_ext/integer')
-rw-r--r--activesupport/lib/active_support/core_ext/integer/even_odd.rb12
1 files changed, 8 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 cfc6b4c6d6..b1d1e28062 100644
--- a/activesupport/lib/active_support/core_ext/integer/even_odd.rb
+++ b/activesupport/lib/active_support/core_ext/integer/even_odd.rb
@@ -3,10 +3,14 @@ module ActiveSupport #:nodoc:
module Integer #:nodoc:
# For checking if a fixnum is even or odd.
#
- # 1.even? # => false
- # 1.odd? # => true
- # 2.even? # => true
- # 2.odd? # => false
+ # 2.even? # => true
+ # 2.odd? # => false
+ # 1.even? # => false
+ # 1.odd? # => true
+ # 0.even? # => true
+ # 0.odd? # => false
+ # -1.even? # => false
+ # -1.odd? # => true
module EvenOdd
def multiple_of?(number)
self % number == 0