Module: ConvenientService::Service::Plugins::CanBeCalled::Concern Private

Includes:
ConvenientService::Support::Concern
Defined in:
lib/convenient_service/service/plugins/can_be_called/concern.rb

Overview

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

Since:

  • 1.0.0

Class Method Summary collapse

Instance Method Summary collapse

Methods included from ConvenientService::Support::Concern

included

Class Method Details

.callHash{Symbol => Object}?

Note:

ConvenientService::Service::Plugins::HasJSendResult::Entities::Result::Plugins::CanBeCalled::Exceptions::ErrorResultIsCalled is aliased as ConvenientService::Result::Exceptions::ErrorResultIsCalled.

Note:

stub_service RSpec helper affects call.

When the result has the success status, it returns the result data as a hash.
When the result has the failure status, it returns nil.
When the result has the error status, it raises an ErrorResultIsCalled exception.



29
30
31
# File 'lib/convenient_service/service/plugins/can_be_called/concern.rb', line 29

def call(...)
  result(...).call
end

Instance Method Details

#callHash{Symbol => Object}?

Note:

ConvenientService::Service::Plugins::HasJSendResult::Entities::Result::Plugins::CanBeCalled::Exceptions::ErrorResultIsCalled is aliased as ConvenientService::Result::Exceptions::ErrorResultIsCalled.

Note:

stub_service RSpec helper affects call.

When the result has the success status, it returns the result data as a hash.
When the result has the failure status, it returns nil.
When the result has the error status, it raises an ErrorResultIsCalled exception.



48
49
50
# File 'lib/convenient_service/service/plugins/can_be_called/concern.rb', line 48

def call
  result.call
end