Sha256: c180bbbe210ef069682627a7673c3ee2b7a88dbf76a98b932d48a4a28c24c28e

Contents?: true

Size: 411 Bytes

Versions: 1

Compression:

Stored size: 411 Bytes

Contents

module ActiveSupport #:nodoc:
  module CoreExtensions #:nodoc:
    module Fixnum #:nodoc:
      # For checking if a fixnum is even or odd. 
      # * 1.even? # => false
      # * 1.odd?  # => true
      # * 2.even? # => true
      # * 2.odd? # => false
      module EvenOdd
        def even?
          self % 2 == 0
        end
        
        def odd?
          !even?
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
activesupport-1.0.4 lib/active_support/core_ext/fixnum/even_odd.rb