| Conditions | 3 |
| Total Lines | 15 |
| Lines | 15 |
| Ratio | 100 % |
| Changes | 0 | ||
| 1 | # frozen_string_literal: true |
||
| 26 | def enumerate(entity, type, context = nil) |
||
| 27 | context ||= Context.new |
||
| 28 | @processor.enumerate(entity, type, context) do |e, t, c| |
||
| 29 | @fallback.enumerate(e, t, c) |
||
| 30 | end |
||
| 31 | rescue StandardError => e |
||
| 32 | raise_if_internal(e) |
||
| 33 | message = "Error while enumerating #{entity.class} " \ |
||
| 34 | "(type: #{type}) attributes using #{@processor}" |
||
| 35 | if e.is_a?(ArgumentError) |
||
| 36 | message += "Does #{@processor}#enumerate have signature " \ |
||
| 37 | '(entity, type, context = nil)?' |
||
| 38 | end |
||
| 39 | mapping_error(message, parent: e, context: context) |
||
| 40 | end |
||
| 41 | end |
||
| 47 |