Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 6c8d354b8d
Fetching contributors…

Cannot retrieve contributors at this time

25 lines (22 sloc) 0.495 kb
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 multiple_of?(number)
self % number == 0
end
def even?
multiple_of? 2
end
def odd?
!even?
end
end
end
end
end
Jump to Line
Something went wrong with that request. Please try again.