class Rammed::Monad::EitherConstructors::Right
Public Class Methods
new(v)
click to toggle source
# File lib/monad/either.rb, line 9 def initialize(v) @v = v end
Public Instance Methods
==(other)
click to toggle source
# File lib/monad/either.rb, line 25 def ==(other) other.respond_to?(:right?) && other.right? && other.instance_variable_get(:@v) == @v end
assign(_, r)
click to toggle source
# File lib/monad/either.rb, line 37 def assign(_, r) r.(@v) nil end
bind(f)
click to toggle source
# File lib/monad/either.rb, line 21 def bind(f) f.(@v) end
extract()
click to toggle source
# File lib/monad/either.rb, line 33 def extract @v end
left?()
click to toggle source
# File lib/monad/either.rb, line 17 def left? false end
mreturn(v)
click to toggle source
# File lib/monad/either.rb, line 29 def mreturn(v) self.class.new(v) end
right?()
click to toggle source
# File lib/monad/either.rb, line 13 def right? true end