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



169
170
171
172
173
# File 'lib/infoboxer/navigation/sections.rb', line 169

%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



175
176
177
178
179
180
181
# File 'lib/infoboxer/navigation/sections.rb', line 175

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

#sections(*names) ⇒ Object



169
170
171
172
173
# File 'lib/infoboxer/navigation/sections.rb', line 169

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