Sha256: 044f108421ec9794bd86c2575298abe9aeb1ba3fa57b588716221d93d90481fe

Contents?: true

Size: 308 Bytes

Versions: 2

Compression:

Stored size: 308 Bytes

Contents

module None
  include Option
  extend self

  def each
  end

  def none?
    true
  end

  def some?(type=nil)
    false
  end

  def value
    raise Option::ValueOfNoneError
  end

  def value_or
    yield
  end

  def & other
    self
  end

  def | other
    other
  end

  def to_s
    "None"
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
optional-0.0.2 lib/optional/none.rb
optional-0.0.1 lib/optional/none.rb