6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
# File 'lib/rbdantic/base/validation.rb', line 6
def initialize(data = {})
data = normalize_attributes(data)
errors, processed, provided, , consumed = [], {}, [], [], []
data = run_before_model_validators(data, errors)
validate_fields(data, processed, errors, provided, consumed)
handle_extra_fields(data, processed, , errors, consumed)
raise ValidationError.new(errors) if errors.any?
finalize_state(processed, provided, )
run_after_model_validators(errors)
raise ValidationError.new(errors) if errors.any?
freeze if self.class.model_config.frozen
end
|