Class: Either::Left
Instance Method Summary collapse
- #flat_map(&block) ⇒ Object
-
#initialize(val) ⇒ Left
constructor
A new instance of Left.
- #left? ⇒ Boolean
- #map(&block) ⇒ Object
- #right? ⇒ Boolean
Methods included from Shared
Constructor Details
#initialize(val) ⇒ Left
Returns a new instance of Left.
35 36 37 |
# File 'lib/either.rb', line 35 def initialize(val) @val = val end |
Instance Method Details
#flat_map(&block) ⇒ Object
43 44 45 |
# File 'lib/either.rb', line 43 def flat_map(&block) self end |
#left? ⇒ Boolean
28 29 30 |
# File 'lib/either.rb', line 28 def left? true end |
#map(&block) ⇒ Object
39 40 41 |
# File 'lib/either.rb', line 39 def map(&block) self end |
#right? ⇒ Boolean
31 32 33 |
# File 'lib/either.rb', line 31 def right? false end |