class Left
Public Class Methods
new(val)
click to toggle source
# File lib/either.rb, line 17 def initialize(val) @val = val end
Public Instance Methods
==(other)
click to toggle source
# File lib/either.rb, line 34 def == (other) other.is_a?(Left) && other.leftval == @val end
fold(left, right)
click to toggle source
# File lib/either.rb, line 30 def fold (left, right) left.call(@val) end
left?()
click to toggle source
# File lib/either.rb, line 21 def left?; true end
left_transform(f)
click to toggle source
# File lib/either.rb, line 26 def left_transform(f) Left.new(f.call(@val)) end
leftval()
click to toggle source
should this be public?
# File lib/either.rb, line 39 def leftval; @val end
right?()
click to toggle source
# File lib/either.rb, line 22 def right?; false end
to_a()
click to toggle source
# File lib/either.rb, line 24 def to_a; [] end