Class: SmartCore::Validator::Invoker Private

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

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(validator) ⇒ 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.

Parameters:

Since:

  • 0.1.0



30
31
32
33
# File 'lib/smart_core/validator/invoker.rb', line 30

def initialize(validator)
  @validator = validator
  @access_lock = Mutex.new
end

Instance Attribute Details

#validatorSmartCore::Validator (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.0k



23
24
25
# File 'lib/smart_core/validator/invoker.rb', line 23

def validator
  @validator
end

Class Method Details

.call(validator, validating_method) ⇒ SmartCore::Validator::ErrorSet

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.

Parameters:

Returns:

Since:

  • 0.1.0



14
15
16
# File 'lib/smart_core/validator/invoker.rb', line 14

def call(validator, validating_method)
  new(validator).call(validating_method)
end

Instance Method Details

#call(validating_method) ⇒ SmartCore::Validator::ErrorSet

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.

Parameters:

  • validating_method (String, Symbol)

Returns:

Since:

  • 0.1.0



40
41
42
43
44
45
46
# File 'lib/smart_core/validator/invoker.rb', line 40

def call(validating_method)
  thread_safe do
    ErrorSet.new.tap do |outer_errors|
      extended_validator(outer_errors).send(validating_method)
    end
  end
end