class Kind::Either::Right
Public Instance Methods
inspect()
click to toggle source
# File lib/kind/either/right.rb, line 34 def inspect '#<%s value=%p>' % ['Kind::Right', value] end
map(&fn)
click to toggle source
# File lib/kind/either/right.rb, line 13 def map(&fn) map!(&fn) rescue Kind::Monad::Error => e raise e rescue StandardError => e Either::Left[e] end
map!(&fn)
click to toggle source
# File lib/kind/either/right.rb, line 21 def map!(&fn) monad = fn.call(@value) return monad if Either::Monad === monad raise Kind::Monad::Error.new('Kind::Right | Kind::Left', monad) end
right?()
click to toggle source
# File lib/kind/either/right.rb, line 5 def right? true end
value_or(_default = UNDEFINED, &block)
click to toggle source
# File lib/kind/either/right.rb, line 9 def value_or(_default = UNDEFINED, &block) @value end