Conditions | 1 |
Total Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | # frozen_string_literal: true |
||
19 | def validate(entity, type, context) |
||
20 | enumerator = type.enumerator.enumerate(entity, type, context) |
||
21 | enumerator.flat_map do |attribute, value, segment = nil| |
||
22 | next_context = segment.nil? ? context : context.advance(segment) |
||
23 | validator = attribute.validator |
||
24 | violations = validator.validate(value, attribute, next_context) |
||
25 | violations.map do |violation| |
||
26 | [attribute, violation, segment] |
||
27 | end |
||
28 | end |
||
29 | end |
||
30 | end |
||
36 |