Class: Kind::Either::Left
- Inherits:
-
Either::Monad
- Object
- Either::Monad
- Kind::Either::Left
- Defined in:
- lib/kind/either/left.rb
Instance Method Summary collapse
- #inspect ⇒ Object
- #left? ⇒ Boolean
- #map(&_) ⇒ Object (also: #map!, #then, #then!, #and_then, #and_then!)
- #value_or(default = UNDEFINED, &block) ⇒ Object
Instance Method Details
#inspect ⇒ Object
25 26 27 |
# File 'lib/kind/either/left.rb', line 25 def inspect '#<%s value=%p>' % ['Kind::Left', value] end |
#map(&_) ⇒ Object Also known as: map!, then, then!, and_then, and_then!
15 16 17 |
# File 'lib/kind/either/left.rb', line 15 def map(&_) self end |
#value_or(default = UNDEFINED, &block) ⇒ Object
9 10 11 12 13 |
# File 'lib/kind/either/left.rb', line 9 def value_or(default = UNDEFINED, &block) Error.invalid_default_arg! if UNDEFINED == default && !block UNDEFINED != default ? default : block.call(value) end |