Sha256: e89265dc99b84e0b15594e480266b8fbd2a64aa46d0515c01e6a9f32ddb6f8e5

Contents?: true

Size: 348 Bytes

Versions: 3

Compression:

Stored size: 348 Bytes

Contents

class Numeric
  def inc
    self + 1
  end

  def dec
    self - 1
  end

  def pos?
    self > 0
  end

  def neg?
    self < 0
  end

  def zero?
    self == 0
  end
end

class Object
  def map?
    false
  end

  def let(*vals)
    yield(self, *vals)
  end

  def fix(pred, f = nil, &fn)
    Rupture::Function.fix(self, pred, fn || f)
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rupture-0.3.0 lib/rupture/core_ext.rb
rupture-0.2.1 lib/rupture/core_ext.rb
rupture-0.2.0 lib/rupture/core_ext.rb