Sha256: 038a1d10ac5cfaae2e8a55422dcd26482c8d3963833360cc15647e970e723dc7

Contents?: true

Size: 355 Bytes

Versions: 12

Compression:

Stored size: 355 Bytes

Contents

class Fixnum
  # Standard in ruby 1.9. See official documentation[http://ruby-doc.org/core-1.9/classes/Fixnum.html]
  def odd?
    self & 1 == 1
  end unless method_defined? :odd?
  
  # Standard in ruby 1.9. See official documentation[http://ruby-doc.org/core-1.9/classes/Fixnum.html]
  def even?
    self & 1 == 0
  end unless method_defined? :even?
end

Version data entries

12 entries across 12 versions & 2 rubygems

Version Path
marcandre-backports-1.0.1 lib/backports/fixnum.rb
marcandre-backports-1.1.1 lib/backports/fixnum.rb
marcandre-backports-1.2.0 lib/backports/fixnum.rb
marcandre-backports-1.3.0 lib/backports/fixnum.rb
marcandre-backports-1.3.1 lib/backports/fixnum.rb
marcandre-backports-1.4.0 lib/backports/fixnum.rb
backports-1.0.0 lib/backports/fixnum.rb
backports-1.1.0 lib/backports/fixnum.rb
backports-1.3.0 lib/backports/fixnum.rb
backports-1.2.0 lib/backports/fixnum.rb
backports-1.1.1 lib/backports/fixnum.rb
backports-1.3.1 lib/backports/fixnum.rb