Sha256: eb4b7f62ac9db8e3a35435fa6c9d519f3d4b7f4dadbd5d61b6836a9b406b6f3a

Contents?: true

Size: 498 Bytes

Versions: 19

Compression:

Stored size: 498 Bytes

Contents

require 'delegate'

class MenuSectionPresenter < SimpleDelegator
  def name
    yield(section.name) if section.respond_to? :name
  end

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

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

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

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

  private

  def section
    __getobj__
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
woople-theme-0.10.0 app/presenters/menu_section_presenter.rb
woople-theme-0.9.0 app/presenters/menu_section_presenter.rb
woople-theme-0.8.19 app/presenters/menu_section_presenter.rb
woople-theme-0.8.18 app/presenters/menu_section_presenter.rb
woople-theme-0.8.17 app/presenters/menu_section_presenter.rb
woople-theme-0.8.16 app/presenters/menu_section_presenter.rb
woople-theme-0.8.15 app/presenters/menu_section_presenter.rb
woople-theme-0.8.14 app/presenters/menu_section_presenter.rb
woople-theme-0.8.13 app/presenters/menu_section_presenter.rb
woople-theme-0.8.12 app/presenters/menu_section_presenter.rb
woople-theme-0.8.11 app/presenters/menu_section_presenter.rb
woople-theme-0.8.10 app/presenters/menu_section_presenter.rb
woople-theme-0.8.9 app/presenters/menu_section_presenter.rb
woople-theme-0.8.8 app/presenters/menu_section_presenter.rb
woople-theme-0.8.7 app/presenters/menu_section_presenter.rb
woople-theme-0.8.6 app/presenters/menu_section_presenter.rb
woople-theme-0.8.5 app/presenters/menu_section_presenter.rb
woople-theme-0.8.4 app/presenters/menu_section_presenter.rb
woople-theme-0.8.3 app/presenters/menu_section_presenter.rb