Class: Qonfig::CommandSet Private
- Inherits:
-
Object
- Object
- Qonfig::CommandSet
- Defined in:
- lib/qonfig/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
- #commands ⇒ Array<Qonfig::Commands::Base> readonly private
Instance Method Summary collapse
- #add_command(command) ⇒ void (also: #<<) private
- #concat(command_set) ⇒ void private
- #dup ⇒ Qonfig::CommandSet private
- #each(&block) ⇒ Enumerable private
-
#initialize ⇒ CommandSet
constructor
private
A new instance of CommandSet.
Constructor Details
#initialize ⇒ 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.
Returns a new instance of CommandSet.
15 16 17 18 |
# File 'lib/qonfig/command_set.rb', line 15 def initialize @commands = [] @access_lock = Mutex.new end |
Instance Attribute Details
#commands ⇒ Array<Qonfig::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.
11 12 13 |
# File 'lib/qonfig/command_set.rb', line 11 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.
25 26 27 |
# File 'lib/qonfig/command_set.rb', line 25 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.
44 45 46 |
# File 'lib/qonfig/command_set.rb', line 44 def concat(command_set) thread_safe { commands.concat(command_set.commands) } end |
#dup ⇒ Qonfig::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.
52 53 54 55 56 |
# File 'lib/qonfig/command_set.rb', line 52 def dup thread_safe do self.class.new.tap { |duplicate| duplicate.concat(self) } 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.
35 36 37 |
# File 'lib/qonfig/command_set.rb', line 35 def each(&block) thread_safe { block_given? ? commands.each(&block) : commands.each } end |