Class: SmartCore::Validator::Commands::AddValidation Private

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

#initialize(validating_method) ⇒ 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:

  • validating_method (String, Symbol)

Since:

  • 0.1.0



18
19
20
# File 'lib/smart_core/validator/commands/add_validation.rb', line 18

def initialize(validating_method)
  @validating_method = validating_method
end

Instance Attribute Details

#validating_methodSymbol, String (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:

  • (Symbol, String)

Since:

  • 0.1.0



11
12
13
# File 'lib/smart_core/validator/commands/add_validation.rb', line 11

def validating_method
  @validating_method
end

Instance Method Details

#call(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.

This method returns an undefined value.

Parameters:

Since:

  • 0.1.0



27
28
29
30
# File 'lib/smart_core/validator/commands/add_validation.rb', line 27

def call(validator)
  errors = SmartCore::Validator::Invoker.call(validator, validating_method)
  validator.__append_errors__(errors) unless errors.empty?
end