Class: Try::Success
Instance Method Summary
collapse
Methods inherited from Base
#initialize
Constructor Details
This class inherits a constructor from Try::Base
Instance Method Details
#fail_map ⇒ Object
49
50
51
|
# File 'lib/trither/try.rb', line 49
def fail_map
self
end
|
#failure? ⇒ Boolean
37
38
39
|
# File 'lib/trither/try.rb', line 37
def failure?
false
end
|
#flat_map {|@value| ... } ⇒ Object
41
42
43
|
# File 'lib/trither/try.rb', line 41
def flat_map
yield @value
end
|
#get_or_else ⇒ Object
53
54
55
|
# File 'lib/trither/try.rb', line 53
def get_or_else
@value
end
|
#map ⇒ Object
45
46
47
|
# File 'lib/trither/try.rb', line 45
def map
Success.new(yield @value)
end
|