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

Version Path
jstorimer-deep-test-2.0.0 sample_rails_project/vendor/rails/activesupport/lib/active_support/core_ext/integer/even_odd.rb
jstorimer-deep-test-1.4.0 sample_rails_project/vendor/rails/activesupport/lib/active_support/core_ext/integer/even_odd.rb
jstorimer-deep-test-1.3.0 sample_rails_project/vendor/rails/activesupport/lib/active_support/core_ext/integer/even_odd.rb
jstorimer-deep-test-1.2.0 sample_rails_project/vendor/rails/activesupport/lib/active_support/core_ext/integer/even_odd.rb
jstorimer-deep-test-1.1.0 sample_rails_project/vendor/rails/activesupport/lib/active_support/core_ext/integer/even_odd.rb
jstorimer-deep-test-1.0.0 sample_rails_project/vendor/rails/activesupport/lib/active_support/core_ext/integer/even_odd.rb
jstorimer-deep-test-0.2.0 sample_rails_project/vendor/rails/activesupport/lib/active_support/core_ext/integer/even_odd.rb
jstorimer-deep-test-0.1.0 sample_rails_project/vendor/rails/activesupport/lib/active_support/core_ext/integer/even_odd.rb
activesupport-1.2.3 lib/active_support/core_ext/integer/even_odd.rb
activesupport-1.2.4 lib/active_support/core_ext/integer/even_odd.rb
activesupport-1.4.2 lib/active_support/core_ext/integer/even_odd.rb
activesupport-1.2.5 lib/active_support/core_ext/integer/even_odd.rb
activesupport-1.3.0 lib/active_support/core_ext/integer/even_odd.rb
activesupport-1.3.1 lib/active_support/core_ext/integer/even_odd.rb
activesupport-1.4.1 lib/active_support/core_ext/integer/even_odd.rb
activesupport-1.2.1 lib/active_support/core_ext/integer/even_odd.rb
activesupport-1.4.0 lib/active_support/core_ext/integer/even_odd.rb
activesupport-1.2.2 lib/active_support/core_ext/integer/even_odd.rb
activesupport-1.4.3 lib/active_support/core_ext/integer/even_odd.rb
activesupport-1.4.4 lib/active_support/core_ext/integer/even_odd.rb