Module: ConvenientService::Service::Plugins::HasJSendResult::Entities::Result::Plugins::CanBeStrict::Concern Private

Includes:
ConvenientService::Support::Concern
Defined in:
lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/can_be_strict/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

Instance Method Summary collapse

Methods included from ConvenientService::Support::Concern

included

Instance Method Details

#strictConvenientService::Service::Plugins::HasJSendResult::Entities::Result

When the result has the success status, it returns self.
When the result has the failure status, it returns copy with error status.
When the result has the error status, it returns self.



38
39
40
41
42
43
44
45
46
47
48
49
# File 'lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/can_be_strict/concern.rb', line 38

def strict
  return self unless status.unsafe_failure?

  copy(
    overrides: {
      kwargs: {
        status: :error,
        strict_result: true
      }
    }
  )
end

#strict?Boolean

Returns:

  • (Boolean)

Since:

  • 1.0.0



25
26
27
# File 'lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/can_be_strict/concern.rb', line 25

def strict?
  Utils.to_bool(extra_kwargs[:strict_result])
end