Class: Refinery::Pages::MenuPresenter
- Inherits:
-
Object
- Object
- Refinery::Pages::MenuPresenter
- Includes:
- ActionView::Helpers::TagHelper, ActionView::Helpers::UrlHelper, ActiveSupport::Configurable
- Defined in:
- 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.
30 31 32 33 |
# File 'app/presenters/refinery/pages/menu_presenter.rb', line 30 def initialize(collection, context) @collection = collection @context = context end |
Instance Attribute Details
#collection ⇒ Object
Returns the value of attribute collection.
27 28 29 |
# File 'app/presenters/refinery/pages/menu_presenter.rb', line 27 def collection @collection end |
#context ⇒ Object
Returns the value of attribute context.
27 28 29 |
# File 'app/presenters/refinery/pages/menu_presenter.rb', line 27 def context @context end |
Instance Method Details
#roots ⇒ Object
23 24 25 |
# File 'app/presenters/refinery/pages/menu_presenter.rb', line 23 def roots config.roots.presence || collection.roots end |
#to_html ⇒ Object
35 36 37 |
# File 'app/presenters/refinery/pages/menu_presenter.rb', line 35 def to_html (roots) if roots.present? end |