Class: Either

Inherits:
Object
  • Object
show all
Includes:
Comparable, LambdaBlock
Defined in:
lib/totally_lazy/either.rb

Direct Known Subclasses

Left, Right

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.left(value) ⇒ Object



46
47
48
# File 'lib/totally_lazy/either.rb', line 46

def self.left(value)
  Left.new(value)
end

.right(value) ⇒ Object



50
51
52
# File 'lib/totally_lazy/either.rb', line 50

def self.right(value)
  Right.new(value)
end

Instance Method Details

#flattenObject



54
55
56
# File 'lib/totally_lazy/either.rb', line 54

def flatten
  flat_map(identity)
end