Class: Solid::Output::CallableAndThen::Caller

Inherits:
Result::CallableAndThen::Caller show all
Defined in:
lib/solid/output/callable_and_then.rb

Defined Under Namespace

Modules: KeyArgs

Class Method Summary collapse

Methods inherited from Result::CallableAndThen::Caller

call

Class Method Details

.ensure_result_object(source, value, result) ⇒ Object



30
31
32
33
34
35
# File 'lib/solid/output/callable_and_then.rb', line 30

def self.ensure_result_object(source, value, result)
  return result.tap { result.send(:memo).then { _1.merge!(value.merge(_1)) } } if result.is_a?(Output)

  raise Result::Error::UnexpectedOutcome.build(outcome: result, origin: source,
                                               expected: Output::EXPECTED_OUTCOME)
end