Sha256: 9438bfb024f4c94903c047860dcc1c77b3278ff0d0a373d7d0af5303585729ec

Contents?: true

Size: 276 Bytes

Versions: 1

Compression:

Stored size: 276 Bytes

Contents

class Left
  include Either

  def self.[] value
    new value
  end

  def initialize(value)
    @value = value
  end

  def left
    Some[value]
  end

  def right
    None
  end

  def left?
    true
  end

  def right?
    false
  end

  private

  attr_reader :value
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
either-0.0.2 lib/left.rb