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
Methods
E
M
O
Instance Public methods
even?()
# File activesupport/lib/active_support/core_ext/integer/even_odd.rb, line 19
def even?
  multiple_of? 2
end
multiple_of?(number)
# File activesupport/lib/active_support/core_ext/integer/even_odd.rb, line 15
def multiple_of?(number)
  self % number == 0
end
odd?()
# File activesupport/lib/active_support/core_ext/integer/even_odd.rb, line 23
def odd?
  !even?
end