Class: Result::Success

Inherits:
Base
  • Object
show all
Defined in:
lib/result/success.rb

Instance Method Summary collapse

Methods inherited from Base

#error, #failure?, #initialize, #on_failure, #or_else

Constructor Details

This class inherits a constructor from Result::Base

Instance Method Details

#and_then {|value| ... } ⇒ Object

Yields:


14
15
16
# File 'lib/result/success.rb', line 14

def and_then
  yield value
end

#on_success {|value| ... } ⇒ Object

Yields:


18
19
20
21
# File 'lib/result/success.rb', line 18

def on_success
  yield value
  super
end

#success?Boolean

Returns:

  • (Boolean)

10
11
12
# File 'lib/result/success.rb', line 10

def success?
  true
end

#valueObject


6
7
8
# File 'lib/result/success.rb', line 6

def value
  @wrapped
end