Class: Resol::Result
- Inherits:
-
Object
- Object
- Resol::Result
- Defined in:
- lib/resol/result.rb
Instance Method Summary collapse
- #either(success_proc, failure_proc) ⇒ Object
- #failure? ⇒ Object
-
#initialize ⇒ Result
constructor
A new instance of Result.
- #or {|@value| ... } ⇒ Object
- #success? ⇒ Object
- #value! ⇒ Object
- #value_or ⇒ Object
Constructor Details
#initialize ⇒ Result
Returns a new instance of Result.
12 |
# File 'lib/resol/result.rb', line 12 def initialize(*); end |
Instance Method Details
#either(success_proc, failure_proc) ⇒ Object
18 19 20 |
# File 'lib/resol/result.rb', line 18 def either(success_proc, failure_proc) success? ? success_proc.call(@value) : failure_proc.call(@value) end |
#failure? ⇒ Object
12 |
# File 'lib/resol/result.rb', line 12 def initialize(*); end |
#or {|@value| ... } ⇒ Object
14 15 16 |
# File 'lib/resol/result.rb', line 14 def or yield(@value) if failure? end |
#success? ⇒ Object
12 |
# File 'lib/resol/result.rb', line 12 def initialize(*); end |
#value! ⇒ Object
12 |
# File 'lib/resol/result.rb', line 12 def initialize(*); end |
#value_or ⇒ Object
12 |
# File 'lib/resol/result.rb', line 12 def initialize(*); end |