| Conditions | 1 |
| Total Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | # frozen_string_literal: true |
||
| 29 | def contains(path) |
||
| 30 | cursor = @root |
||
| 31 | path.each do |segment| |
||
| 32 | return false unless cursor.respond_to?(:key?) |
||
| 33 | candidates = [segment.to_s, segment.to_sym] |
||
| 34 | next_segment = candidates.find do |candidate| |
||
| 35 | cursor.key?(candidate) |
||
| 36 | end |
||
| 37 | return false unless next_segment |
||
| 38 | cursor = cursor[next_segment] |
||
| 39 | end |
||
| 40 | true |
||
| 41 | end |
||
| 42 | end |
||
| 48 |