Class: SmartCore::Operation::StepSet Private

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/smart_core/operation/step_set.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:

  • 0.5.0

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializevoid

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:

  • 0.5.0



19
20
21
22
# File 'lib/smart_core/operation/step_set.rb', line 19

def initialize
  @steps = []
  @access_lock = Mutex.new
end

Instance Attribute Details

#stepsArray<SmartCore:::Operation::Step> (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.

Returns:

  • (Array<SmartCore:::Operation::Step>)

Since:

  • 0.5.0



13
14
15
# File 'lib/smart_core/operation/step_set.rb', line 13

def steps
  @steps
end

Instance Method Details

#add_step(step) ⇒ void Also known as: <<

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.

This method returns an undefined value.

Parameters:

Since:

  • 0.5.0



29
30
31
# File 'lib/smart_core/operation/step_set.rb', line 29

def add_step(step)
  thread_safe { steps << step }
end

#concat(step_set) ⇒ 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.

This method returns an undefined value.

Parameters:

Since:

  • 0.5.0



39
40
41
# File 'lib/smart_core/operation/step_set.rb', line 39

def concat(step_set)
  thread_safe { steps.concat(step_set.dup.steps) }
end

#dupObject

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:

  • 0.5.0



47
48
49
50
51
52
53
# File 'lib/smart_core/operation/step_set.rb', line 47

def dup
  thread_safe do
    self.class.new.tap do |duplicate|
      steps.each { |step| duplicate.add_step(step.dup) }
    end
  end
end

#each(&block) ⇒ Enumerable

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:

  • (Enumerable)

Since:

  • 0.5.0



59
60
61
# File 'lib/smart_core/operation/step_set.rb', line 59

def each(&block)
  thread_safe { block_given? ? steps.each(&block) : steps.each }
end