Class: Try::Failure
Constant Summary
Trither::BasicTypes::C, Trither::BasicTypes::Func0, Trither::BasicTypes::Func1, Trither::BasicTypes::Predicate
Constants inherited
from Trither::Box
Trither::Box::C
Instance Method Summary
collapse
#==, #initialize
Constructor Details
This class inherits a constructor from Trither::Box
Instance Method Details
#fail_map ⇒ Object
48
49
50
|
# File 'lib/trither/try.rb', line 48
def fail_map
Failure.new yield(@value)
end
|
#failure? ⇒ Boolean
28
29
30
|
# File 'lib/trither/try.rb', line 28
def failure?
true
end
|
#filter ⇒ Object
33
34
35
|
# File 'lib/trither/try.rb', line 33
def filter
self
end
|
#flat_map ⇒ Object
38
39
40
|
# File 'lib/trither/try.rb', line 38
def flat_map
self
end
|
#get_or_else {|@value| ... } ⇒ Object
58
59
60
|
# File 'lib/trither/try.rb', line 58
def get_or_else
yield @value
end
|
#map ⇒ Object
43
44
45
|
# File 'lib/trither/try.rb', line 43
def map
self
end
|
#or_else {|@value| ... } ⇒ Object
53
54
55
|
# File 'lib/trither/try.rb', line 53
def or_else
yield @value
end
|