Class: ConvenientService::Service::Plugins::CanHaveSteps::Entities::Step::Plugins::CanBeMethodStep::Commands::CalculateMethodResult

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from ConvenientService::Support::Command

[], call

Constructor Details

#initialize(step:) ⇒ void



23
24
25
# File 'lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/can_be_method_step/commands/calculate_method_result.rb', line 23

def initialize(step:)
  @step = step
end

Instance Attribute Details

#stepObject (readonly)

Returns the value of attribute step.



17
18
19
# File 'lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/can_be_method_step/commands/calculate_method_result.rb', line 17

def step
  @step
end

Instance Method Details

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



31
32
33
34
35
36
# File 'lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/can_be_method_step/commands/calculate_method_result.rb', line 31

def call
  ::ConvenientService.raise Exceptions::StepIsNotMethodStep.new(step: step) unless step.method_step?
  ::ConvenientService.raise Exceptions::MethodForStepIsNotDefined.new(step: step) unless own_method

  call_method(own_method)
end