Class: SmartCore::Validator::ErrorsController::Base
- Inherits:
-
Object
- Object
- SmartCore::Validator::ErrorsController::Base
show all
- Defined in:
- lib/smart_core/validator/errors_controller/base.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
#initialize ⇒ Base
Returns a new instance of Base.
6
7
8
|
# File 'lib/smart_core/validator/errors_controller/base.rb', line 6
def initialize
@errors = SmartCore::Validator::Errors.new
end
|
Instance Attribute Details
#errors ⇒ Object
Returns the value of attribute errors.
4
5
6
|
# File 'lib/smart_core/validator/errors_controller/base.rb', line 4
def errors
@errors
end
|
Instance Method Details
#apply_data_to_errors! ⇒ Object
|
# File 'lib/smart_core/validator/errors_controller/base.rb', line 26
|
#error_will_be_skipped? ⇒ Object
|
# File 'lib/smart_core/validator/errors_controller/base.rb', line 26
|
#process_rule!(result) ⇒ Object
16
17
18
19
20
|
# File 'lib/smart_core/validator/errors_controller/base.rb', line 16
def process_rule!(result)
return if result == nil
apply_data_to_errors!(result.attr_path, result.code)
end
|
#process_smart_schema_result!(result) ⇒ Object
10
11
12
13
14
|
# File 'lib/smart_core/validator/errors_controller/base.rb', line 10
def process_smart_schema_result!(result)
result.errors.each do |attr_path, error_codes|
apply_data_to_errors!(attr_path, *error_codes)
end
end
|
#validation_fails? ⇒ Boolean
22
23
24
|
# File 'lib/smart_core/validator/errors_controller/base.rb', line 22
def validation_fails?
@validation_fails ||= errors.any?
end
|