Class: ConvenientService::Service::Plugins::CanHaveStubbedResults::Commands::SetServiceStubbedResult Private

Inherits:
ConvenientService::Support::Command show all
Defined in:
lib/convenient_service/service/plugins/can_have_stubbed_results/commands/set_service_stubbed_result.rb

Overview

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

Since:

  • 1.0.0

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from ConvenientService::Support::Command

[], call

Constructor Details

#initialize(service:, arguments:, result:) ⇒ void

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



38
39
40
41
42
# File 'lib/convenient_service/service/plugins/can_have_stubbed_results/commands/set_service_stubbed_result.rb', line 38

def initialize(service:, arguments:, result:)
  @service = service
  @arguments = arguments
  @result = result
end

Instance Attribute Details

#argumentsObject (readonly)

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

Since:

  • 1.0.0



24
25
26
# File 'lib/convenient_service/service/plugins/can_have_stubbed_results/commands/set_service_stubbed_result.rb', line 24

def arguments
  @arguments
end

#resultObject (readonly)

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

Since:

  • 1.0.0



30
31
32
# File 'lib/convenient_service/service/plugins/can_have_stubbed_results/commands/set_service_stubbed_result.rb', line 30

def result
  @result
end

#serviceObject (readonly)

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

Since:

  • 1.0.0



18
19
20
# File 'lib/convenient_service/service/plugins/can_have_stubbed_results/commands/set_service_stubbed_result.rb', line 18

def service
  @service
end

Instance Method Details

#callConvenientService::Service::Plugins::HasJSendResult::Entities::Result

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



50
51
52
53
54
55
56
# File 'lib/convenient_service/service/plugins/can_have_stubbed_results/commands/set_service_stubbed_result.rb', line 50

def call
  if arguments.nil?
    cache.default = result
  else
    cache.write(cache.keygen(*arguments.args, **arguments.kwargs, &arguments.block), result)
  end
end