Class: ConvenientService::Service::Plugins::CollectsServicesInException::Commands::ExtractServiceDetails Private

Inherits:
ConvenientService::Support::Command show all
Defined in:
lib/convenient_service/service/plugins/collects_services_in_exception/commands/extract_service_details.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:, method:) ⇒ 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.

Parameters:

Since:

  • 1.0.0



30
31
32
33
# File 'lib/convenient_service/service/plugins/collects_services_in_exception/commands/extract_service_details.rb', line 30

def initialize(service:, method:)
  @service = service
  @method = method
end

Instance Attribute Details

#methodObject (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/collects_services_in_exception/commands/extract_service_details.rb', line 24

def method
  @method
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/collects_services_in_exception/commands/extract_service_details.rb', line 18

def service
  @service
end

Instance Method Details

#callHash{Symbol => Object}

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.

Returns:

  • (Hash{Symbol => Object})

Since:

  • 1.0.0



38
39
40
# File 'lib/convenient_service/service/plugins/collects_services_in_exception/commands/extract_service_details.rb', line 38

def call
  {instance: service, trigger: trigger}
end

#first_not_evaluated_stepConvenientService::Service::Plugins::CanHaveSteps::Entities::Step?

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.



61
62
63
# File 'lib/convenient_service/service/plugins/collects_services_in_exception/commands/extract_service_details.rb', line 61

def first_not_evaluated_step
  Utils.memoize_including_falsy_values(self, :@first_not_evaluated_step) { service.steps.find(&:not_evaluated?) }
end

#triggerHash{Symbol => Object}

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.

Returns:

  • (Hash{Symbol => Object})

Since:

  • 1.0.0



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

def trigger
  return {method: ":#{method}"} if method != :result
  return {method: ":result"} if service.steps.none?
  return {step: "Unknown Step", index: -1} unless first_not_evaluated_step

  {step: first_not_evaluated_step.printable_action, index: first_not_evaluated_step.index}
end