Class: SmartCore::Validator::Commands::AddValidation Private
- 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.
Instance Attribute Summary collapse
- #validating_method ⇒ Symbol, String readonly private
Instance Method Summary collapse
- #call(validator) ⇒ void private
- #initialize(validating_method) ⇒ void constructor private
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.
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_method ⇒ Symbol, 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.
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.
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 |