Module: Infoboxer::Navigation::Lookup::Nodes

Included in:
Tree::Nodes
Defined in:
lib/infoboxer/navigation/lookup.rb

Overview

This module provides implementations for all lookup_* methods of Node for be used on nodes list. Note, that all those methods return flat list of results (so, if you have found several nodes, and then look for their siblings, you should not expect array of arrays -- just one array of nodes).

See Node for detailed lookups and selectors explanation.

Instance Method Summary collapse

Instance Method Details

#_find(selector) ⇒ Object

Underscored version of #find.



196
197
198
# File 'lib/infoboxer/navigation/lookup.rb', line 196

def _find(selector)
  select { |n| n._matches?(selector) }
end

#_lookup(selector) ⇒ Object



# File 'lib/infoboxer/navigation/lookup.rb', line 188

#_lookup_children(selector) ⇒ Object



# File 'lib/infoboxer/navigation/lookup.rb', line 188

#_lookup_next_siblings(selector) ⇒ Object



# File 'lib/infoboxer/navigation/lookup.rb', line 188

#_lookup_parents(selector) ⇒ Object



# File 'lib/infoboxer/navigation/lookup.rb', line 188

#_lookup_prev_siblings(selector) ⇒ Object



# File 'lib/infoboxer/navigation/lookup.rb', line 188

#_lookup_siblings(selector) ⇒ Object



# File 'lib/infoboxer/navigation/lookup.rb', line 188

#find(*selectors, &block) ⇒ Object

Selects nodes of current list (and only it, no children checks), which are matching selectors.



202
203
204
# File 'lib/infoboxer/navigation/lookup.rb', line 202

def find(*selectors, &block)
  _find(Selector.new(*selectors, &block))
end

#lookup(*selectors, &block) ⇒ Object



# File 'lib/infoboxer/navigation/lookup.rb', line 181

#lookup_children(*selectors, &block) ⇒ Object



# File 'lib/infoboxer/navigation/lookup.rb', line 181

#lookup_next_siblings(*selectors, &block) ⇒ Object



# File 'lib/infoboxer/navigation/lookup.rb', line 181

#lookup_parents(*selectors, &block) ⇒ Object



# File 'lib/infoboxer/navigation/lookup.rb', line 181

#lookup_prev_siblings(*selectors, &block) ⇒ Object



# File 'lib/infoboxer/navigation/lookup.rb', line 181

#lookup_siblings(*selectors, &block) ⇒ Object



# File 'lib/infoboxer/navigation/lookup.rb', line 181