class Rammed::Monad::EitherConstructors::Left
Public Class Methods
new(v)
click to toggle source
# File lib/monad/either.rb, line 45 def initialize(v) @v = v end
Public Instance Methods
==(other)
click to toggle source
# File lib/monad/either.rb, line 61 def ==(other) other.respond_to?(:left?) && other.left? && other.instance_variable_get(:@v) == @v end
assign(l, _)
click to toggle source
# File lib/monad/either.rb, line 69 def assign(l, _) l.(@v) nil end
bind(_)
click to toggle source
# File lib/monad/either.rb, line 57 def bind(_) self end
extract()
click to toggle source
# File lib/monad/either.rb, line 65 def extract @v end
left?()
click to toggle source
# File lib/monad/either.rb, line 53 def left? true end
right?()
click to toggle source
# File lib/monad/either.rb, line 49 def right? false end