Sha256: 1c175252d025be8264d7c6a8deb650534ca085e1a29599a9f0606cb2bd6baa92
Contents?: true
Size: 496 Bytes
Versions: 86
Compression:
Stored size: 496 Bytes
Contents
module ActiveSupport #:nodoc: module CoreExtensions #:nodoc: module Integer #: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
Version data entries
86 entries across 86 versions & 6 rubygems