Class: Either::Left

Inherits:
Base
  • Object
show all
Defined in:
lib/trither/either.rb

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Either::Base

Instance Method Details

#leftObject



17
18
19
# File 'lib/trither/either.rb', line 17

def left
  @value
end

#left?Boolean

Returns:

  • (Boolean)


9
10
11
# File 'lib/trither/either.rb', line 9

def left?
  true
end

#left_mapObject



21
22
23
# File 'lib/trither/either.rb', line 21

def left_map
  Left.new(yield @value)
end

#right?Boolean

Returns:

  • (Boolean)


13
14
15
# File 'lib/trither/either.rb', line 13

def right?
  false
end

#right_mapObject



25
26
27
# File 'lib/trither/either.rb', line 25

def right_map
  self
end