Module: ConvenientService::Service::Plugins::CanHaveSequentialSteps::Concern

Includes:
ConvenientService::Support::Concern
Defined in:
lib/convenient_service/service/plugins/can_have_sequential_steps/concern.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.step(*args, **kwargs) ⇒ ConvenientService::Service::Plugins::CanHaveSteps::Entities::Step

Registers a step (step definition).

Parameters:

  • args (Array<Object>)
  • kwargs (Hash{Symbol => Object})

Returns:



20
21
22
# File 'lib/convenient_service/service/plugins/can_have_sequential_steps/concern.rb', line 20

def step(*args, **kwargs)
  steps.create(*args, **kwargs)
end

.stepsConvenientService::Service::Plugins::CanHaveSteps::Entities::StepCollection

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:

  • (ConvenientService::Service::Plugins::CanHaveSteps::Entities::StepCollection)


29
30
31
# File 'lib/convenient_service/service/plugins/can_have_sequential_steps/concern.rb', line 29

def steps
  internals_class.cache.fetch(:steps) { Entities::StepCollection.new(container: self) }
end

Instance Method Details

#stepsConvenientService::Service::Plugins::CanHaveSteps::Entities::StepСollection

Note:

May be useful for debugging purposes.

Note:

steps are frozen.



46
47
48
49
50
51
52
53
54
# File 'lib/convenient_service/service/plugins/can_have_sequential_steps/concern.rb', line 46

def steps
  internals.cache.fetch(:steps) do
    self.class
      .steps
      .tap(&:commit!)
      .with_organizer(self)
      .tap(&:commit!)
  end
end