Class: ConvenientService::Service::Plugins::CollectsServicesInException::Commands::ExtractServiceDetails
- Inherits:
-
ConvenientService::Support::Command
- Object
- ConvenientService::Support::Command
- ConvenientService::Service::Plugins::CollectsServicesInException::Commands::ExtractServiceDetails
- Defined in:
- lib/convenient_service/service/plugins/collects_services_in_exception/commands/extract_service_details.rb
Instance Attribute Summary collapse
-
#method ⇒ Object
readonly
Returns the value of attribute method.
-
#service ⇒ Object
readonly
Returns the value of attribute service.
Instance Method Summary collapse
- #call ⇒ Hash{Symbol => Object}
- #first_not_evaluated_step ⇒ ConvenientService::Service::Plugins::CanHaveSteps::Entities::Step?
- #initialize(service:, method:) ⇒ void constructor
- #trigger ⇒ Hash{Symbol => Object}
Methods inherited from ConvenientService::Support::Command
Constructor Details
#initialize(service:, method:) ⇒ void
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
#method ⇒ Object (readonly)
Returns the value of attribute method.
24 25 26 |
# File 'lib/convenient_service/service/plugins/collects_services_in_exception/commands/extract_service_details.rb', line 24 def method @method end |
#service ⇒ Object (readonly)
Returns the value of attribute service.
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
#call ⇒ Hash{Symbol => Object}
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_step ⇒ ConvenientService::Service::Plugins::CanHaveSteps::Entities::Step?
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 |
#trigger ⇒ Hash{Symbol => Object}
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 |