Class: Katapult::Navigation

Inherits:
Element
  • Object
show all
Defined in:
lib/katapult/elements/navigation.rb

Constant Summary

Constants inherited from Element

Element::UnknownFormattingError, Element::UnknownOptionError

Instance Attribute Summary

Attributes inherited from Element

#application_model, #name, #options

Instance Method Summary collapse

Methods inherited from Element

#initialize

Constructor Details

This class inherits a constructor from Katapult::Element

Instance Method Details



13
14
15
16
17
18
19
20
# File 'lib/katapult/elements/navigation.rb', line 13

def links
  web_uis.each_with_object({}) do |web_ui, map|
    next unless web_ui.find_action(:index).present?

    label = web_ui.model_name :humans
    map[label] = web_ui.path(:index)
  end
end

#render(options = {}) ⇒ Object



22
23
24
# File 'lib/katapult/elements/navigation.rb', line 22

def render(options = {})
  Generators::NavigationGenerator.new(self, options).invoke_all
end

#web_uisObject



9
10
11
# File 'lib/katapult/elements/navigation.rb', line 9

def web_uis
  application_model.web_uis
end