Class: SmartCore::Container::DefinitionDSL::CommandSet Private
- Inherits:
-
Object
- Object
- SmartCore::Container::DefinitionDSL::CommandSet
- Includes:
- Enumerable
- Defined in:
- lib/smart_core/container/definition_dsl/command_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.
Instance Attribute Summary collapse
Instance Method Summary collapse
- #add_command(command) ⇒ void (also: #<<) private
- #concat(command_set) ⇒ void private
- #dup ⇒ SmartCore::Container::DefinitionDSL::CommandSet private
- #each(&block) ⇒ Enumerable private
- #initialize ⇒ void constructor private
Constructor Details
#initialize ⇒ 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.
19 20 21 22 |
# File 'lib/smart_core/container/definition_dsl/command_set.rb', line 19 def initialize @commands = [] @access_lock = SmartCore::Container::ArbitaryLock.new end |
Instance Attribute Details
#commands ⇒ Array<SmartCore::Container::DefinitionDSL::Commands::Base> (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.
13 14 15 |
# File 'lib/smart_core/container/definition_dsl/command_set.rb', line 13 def commands @commands end |
Instance Method Details
#add_command(command) ⇒ 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.
29 30 31 |
# File 'lib/smart_core/container/definition_dsl/command_set.rb', line 29 def add_command(command) thread_safe { commands << command } end |
#concat(command_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.
48 49 50 |
# File 'lib/smart_core/container/definition_dsl/command_set.rb', line 48 def concat(command_set) thread_safe { commands.concat(command_set.dup.commands) } end |
#dup ⇒ SmartCore::Container::DefinitionDSL::CommandSet
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.
56 57 58 59 60 61 62 63 64 |
# File 'lib/smart_core/container/definition_dsl/command_set.rb', line 56 def dup thread_safe do self.class.new.tap do |duplicate| commands.each do |command| duplicate.add_command(command.dup) end 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.
39 40 41 |
# File 'lib/smart_core/container/definition_dsl/command_set.rb', line 39 def each(&block) thread_safe { block_given? ? commands.each(&block) : commands.each } end |