Method: Decode::Trie::Node#lookup

Defined in:
lib/decode/trie.rb

#lookup(path, index = 0) ⇒ Object

Look up a lexical path starting at this node.



41
42
43
44
45
46
47
48
49
# File 'lib/decode/trie.rb', line 41

def lookup(path, index = 0)
  if index < path.size
    if child = @children[path[index]]
      return child.lookup(path, index+1)
    end
  else
    return self
  end
end