Class: MenuSectionPresenter

Inherits:
SimpleDelegator
  • Object
show all
Defined in:
app/presenters/menu_section_presenter.rb

Instance Method Summary collapse

Instance Method Details



8
9
10
11
12
# File 'app/presenters/menu_section_presenter.rb', line 8

def links
  return [] unless section.respond_to? :links

  @links ||= ThemePresentation.wrap_collection(section.links, MenuLinkPresenter)
end

#name {|section.name| ... } ⇒ Object

Yields:



4
5
6
# File 'app/presenters/menu_section_presenter.rb', line 4

def name
  yield(section.name) if section.respond_to? :name
end

#widgetsObject



14
15
16
17
18
# File 'app/presenters/menu_section_presenter.rb', line 14

def widgets
  return [] unless section.respond_to? :widgets

  @widgets ||= ThemePresentation.wrap_collection(section.widgets, MenuWidgetPresenter)
end