Class: ConvenientService::Service::Plugins::CanHaveSteps::Entities::Step::Plugins::CanBeServiceStep::Commands::CalculateServiceResult

Inherits:
ConvenientService::Support::Command show all
Defined in:
lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/can_be_service_step/commands/calculate_service_result.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from ConvenientService::Support::Command

[], call

Constructor Details

#initialize(step:) ⇒ void



28
29
30
# File 'lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/can_be_service_step/commands/calculate_service_result.rb', line 28

def initialize(step:)
  @step = step
end

Instance Attribute Details

#stepObject (readonly)

Returns the value of attribute step.



22
23
24
# File 'lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/can_be_service_step/commands/calculate_service_result.rb', line 22

def step
  @step
end

Instance Method Details

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

Returns:

Raises:

  • (ConvenientService::Service::Plugins::CanHaveSteps::Entities::Step::Plugins::CanBeMethodStep::Exceptions::StepIsNotServiceStep)


39
40
41
42
43
# File 'lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/can_be_service_step/commands/calculate_service_result.rb', line 39

def call
  ::ConvenientService.raise Exceptions::StepIsNotServiceStep.new(step: step) unless step.service_step?

  service.result(**input_values)
end