Module: Infoboxer::Navigation::Sections::Nodes

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

Overview

Part of Infoboxer::Navigation::Sections navigation, allowing chains of section search.

See parent module documentation.

Instance Method Summary collapse

Instance Method Details

#in_sectionsObject



165
166
167
168
169
# File 'lib/infoboxer/navigation/sections.rb', line 165

%i[sections in_sections].each do |sym|
  define_method(sym) do |*args|
    make_nodes(map { |n| n.send(sym, *args) })
  end
end

#lookup_children(*arg) ⇒ Object



171
172
173
174
175
176
177
# File 'lib/infoboxer/navigation/sections.rb', line 171

def lookup_children(*arg)
  if arg.include?(:Section)
    sections.find(*(arg - [:Section]))
  else
    super
  end
end

#sections(*names) ⇒ Object



165
166
167
168
169
# File 'lib/infoboxer/navigation/sections.rb', line 165

%i[sections in_sections].each do |sym|
  define_method(sym) do |*args|
    make_nodes(map { |n| n.send(sym, *args) })
  end
end