Method: Path#backfind
- Defined in:
- lib/path.rb
#backfind(path) ⇒ Object
110 111 112 113 114 115 116 |
# File 'lib/path.rb', line 110 def backfind(path) condition = path[/\[(.*)\]$/, 1] || '' path = $` unless condition.empty? result = ancestors.find { |ancestor| (ancestor/path/condition).exist? } result/path if result end |