Class: SmartCore::Validator::CommandSet Private

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

Since:

  • 0.1.0

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeCommandSet

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.

Since:

  • 0.1.0



17
18
19
20
# File 'lib/smart_core/validator/command_set.rb', line 17

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

Instance Attribute Details

#commandsArray<SmartCore::Validator::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.

Returns:

Since:

  • 0.1.0



13
14
15
# File 'lib/smart_core/validator/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.

Parameters:

Since:

  • 0.1.0



27
28
29
# File 'lib/smart_core/validator/command_set.rb', line 27

def add_command(command)
  thread_safe { commands << command }
end

#clearvoid

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.

Since:

  • 0.1.0



54
55
56
# File 'lib/smart_core/validator/command_set.rb', line 54

def clear
  thread_safe { commands.clear }
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.

Parameters:

Since:

  • 0.1.0



46
47
48
# File 'lib/smart_core/validator/command_set.rb', line 46

def concat(command_set)
  thread_safe { commands.concat(command_set.commands) }
end

#each {|SmartCore::Validator::Commands::Base| ... } ⇒ 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.

Yields:

Returns:

  • (Enumerable)

Since:

  • 0.1.0



37
38
39
# File 'lib/smart_core/validator/command_set.rb', line 37

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