Class: Decidim::MenuPresenter
- Inherits:
-
Object
- Object
- Decidim::MenuPresenter
- Defined in:
- app/presenters/decidim/menu_presenter.rb
Overview
A presenter to render menus
Direct Known Subclasses
Instance Method Summary collapse
- #evaluated_menu ⇒ Object
-
#initialize(name, view, options = {}) ⇒ MenuPresenter
constructor
Initializes a menu for presentation.
- #render ⇒ Object
Constructor Details
#initialize(name, view, options = {}) ⇒ MenuPresenter
Initializes a menu for presentation
13 14 15 16 17 |
# File 'app/presenters/decidim/menu_presenter.rb', line 13 def initialize(name, view, = {}) @name = name @view = view @options = end |
Instance Method Details
#evaluated_menu ⇒ Object
22 23 24 25 26 27 28 |
# File 'app/presenters/decidim/menu_presenter.rb', line 22 def @evaluated_menu ||= begin = Menu.new(@name) .build_for(@view) end end |
#render ⇒ Object
30 31 32 33 34 |
# File 'app/presenters/decidim/menu_presenter.rb', line 30 def render content_tag :nav, class: "main-nav", "aria-label": @options.fetch(:label, nil) do end end |