For checking if a fixnum is even or odd.
2.even? # => true 2.odd? # => false 1.even? # => false 1.odd? # => true 0.even? # => true 0.odd? # => false -1.even? # => false -1.odd? # => true
# File lib/active_support/core_ext/integer/even_odd.rb, line 19 def even? multiple_of? 2 end
Generated with the Darkfish Rdoc Generator 2.