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
Public Instance methods
even?()
    # File activesupport/lib/active_support/core_ext/integer/even_odd.rb, line 19
19:         def even?
20:           multiple_of? 2
21:         end
multiple_of?(number)
    # File activesupport/lib/active_support/core_ext/integer/even_odd.rb, line 15
15:         def multiple_of?(number)
16:           self % number == 0
17:         end
odd?()
    # File activesupport/lib/active_support/core_ext/integer/even_odd.rb, line 23
23:         def odd?
24:           !even?
25:         end