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

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

Class Method Summary collapse

Instance Method Summary collapse

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