Class: SmartCore::Validator::ErrorSet Private
- Inherits:
-
Object
- Object
- SmartCore::Validator::ErrorSet
- Defined in:
- lib/smart_core/validator/error_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 Method Summary collapse
- #add_error(error_code) ⇒ void private
- #clear ⇒ void private
- #codes ⇒ Array<Symbol> private
- #concat(error_set) ⇒ void private
- #empty? ⇒ Boolean 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.
11 12 13 14 |
# File 'lib/smart_core/validator/error_set.rb', line 11 def initialize @errors = Set.new @access_lock = Mutex.new end |
Instance Method Details
#add_error(error_code) ⇒ 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.
21 22 23 |
# File 'lib/smart_core/validator/error_set.rb', line 21 def add_error(error_code) thread_safe { store_error(error_code) } end |
#clear ⇒ 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.
50 51 52 |
# File 'lib/smart_core/validator/error_set.rb', line 50 def clear thread_safe { errors.clear } end |
#codes ⇒ Array<Symbol>
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.
58 59 60 |
# File 'lib/smart_core/validator/error_set.rb', line 58 def codes thread_safe { errors.to_a } end |
#concat(error_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.
30 31 32 33 34 35 36 |
# File 'lib/smart_core/validator/error_set.rb', line 30 def concat(error_set) thread_safe do error_set.codes.each do |error_code| store_error(error_code) end end end |
#empty? ⇒ Boolean
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.
42 43 44 |
# File 'lib/smart_core/validator/error_set.rb', line 42 def empty? thread_safe { errors.empty? } end |