Class: Refinery::Pages::MenuPresenter
- Inherits:
-
Object
- Object
- Refinery::Pages::MenuPresenter
- Includes:
- ActionView::Helpers::TagHelper, ActionView::Helpers::UrlHelper, ActiveSupport::Configurable
- Defined in:
- pages/app/presenters/refinery/pages/menu_presenter.rb
Instance Attribute Summary collapse
-
#collection ⇒ Object
Returns the value of attribute collection.
-
#context ⇒ Object
Returns the value of attribute context.
Instance Method Summary collapse
-
#initialize(collection, context) ⇒ MenuPresenter
constructor
A new instance of MenuPresenter.
- #roots ⇒ Object
- #to_html ⇒ Object
Constructor Details
#initialize(collection, context) ⇒ MenuPresenter
Returns a new instance of MenuPresenter.
34 35 36 37 |
# File 'pages/app/presenters/refinery/pages/menu_presenter.rb', line 34 def initialize(collection, context) @collection = collection @context = context end |
Instance Attribute Details
#collection ⇒ Object
Returns the value of attribute collection.
31 32 33 |
# File 'pages/app/presenters/refinery/pages/menu_presenter.rb', line 31 def collection @collection end |
#context ⇒ Object
Returns the value of attribute context.
31 32 33 |
# File 'pages/app/presenters/refinery/pages/menu_presenter.rb', line 31 def context @context end |
Instance Method Details
#roots ⇒ Object
27 28 29 |
# File 'pages/app/presenters/refinery/pages/menu_presenter.rb', line 27 def roots config.roots.presence || collection.roots end |
#to_html ⇒ Object
39 40 41 |
# File 'pages/app/presenters/refinery/pages/menu_presenter.rb', line 39 def to_html (roots) if roots.present? end |