Class: Either::Left
Instance Method Summary
collapse
Methods inherited from Base
#initialize
Constructor Details
This class inherits a constructor from Either::Base
Instance Method Details
#left ⇒ Object
17
18
19
|
# File 'lib/trither/either.rb', line 17
def left
@value
end
|
#left? ⇒ Boolean
9
10
11
|
# File 'lib/trither/either.rb', line 9
def left?
true
end
|
#left_map ⇒ Object
21
22
23
|
# File 'lib/trither/either.rb', line 21
def left_map
Left.new(yield @value)
end
|
#right? ⇒ Boolean
13
14
15
|
# File 'lib/trither/either.rb', line 13
def right?
false
end
|
#right_map ⇒ Object
25
26
27
|
# File 'lib/trither/either.rb', line 25
def right_map
self
end
|