Class: Deterministic::Either
Defined Under Namespace
Classes: AttemptAll
Class Method Summary
collapse
Instance Method Summary
collapse
#match
Methods included from Monad
#==, #bind, #initialize, #join, #map, #to_s, #value
Class Method Details
.attempt_all(context = OpenStruct.new, &block) ⇒ Object
4
5
6
|
# File 'lib/deterministic/either/attempt_all.rb', line 4
def self.attempt_all(context=OpenStruct.new, &block)
AttemptAll.new(context, &block).call
end
|
Instance Method Details
#<<(other) ⇒ Object
14
15
16
17
|
# File 'lib/deterministic/either.rb', line 14
def <<(other)
return self if failure?
return other if other.is_a? Either
end
|
#failure? ⇒ Boolean
10
11
12
|
# File 'lib/deterministic/either.rb', line 10
def failure?
is_a? Failure
end
|
#success? ⇒ Boolean
6
7
8
|
# File 'lib/deterministic/either.rb', line 6
def success?
is_a? Success
end
|