Method: Jsus::Util::Tree#lookup

Defined in:
lib/jsus/util/tree.rb

#lookup(path) ⇒ Jsus::Util::Tree::Node

Looks up a node by direct path. Does not support wildcards

Parameters:

  • path (String)

Returns:



156
157
158
159
160
161
162
163
# File 'lib/jsus/util/tree.rb', line 156

def lookup(path)
  path_components = self.class.get_path_components(path)
  path_components.inject(root) do |result, component|
    if result
      result.find_child(component)
    end
  end
end