Class: Spina::Pages::Breadcrumb
- Inherits:
-
Object
- Object
- Spina::Pages::Breadcrumb
- Includes:
- ActionView::Helpers::TagHelper, ActionView::Helpers::UrlHelper, ActiveSupport::Configurable
- Defined in:
- app/presenters/spina/pages/breadcrumb.rb
Instance Attribute Summary collapse
-
#breadcrumb_items ⇒ Object
Returns the value of attribute breadcrumb_items.
-
#context ⇒ Object
Returns the value of attribute context.
-
#current_page ⇒ Object
Returns the value of attribute current_page.
-
#homepage ⇒ Object
Returns the value of attribute homepage.
-
#include_homepage ⇒ Object
Returns the value of attribute include_homepage.
Instance Method Summary collapse
-
#initialize(page, context, include_homepage = true) ⇒ Breadcrumb
constructor
A new instance of Breadcrumb.
- #to_html ⇒ Object
Constructor Details
#initialize(page, context, include_homepage = true) ⇒ Breadcrumb
Returns a new instance of Breadcrumb.
25 26 27 28 29 30 31 32 33 |
# File 'app/presenters/spina/pages/breadcrumb.rb', line 25 def initialize(page, context, include_homepage = true) @current_page = page @include_homepage = include_homepage @context = context @breadcrumb_items = Array.new() @homepage = Page.find_by(name: :homepage) (page) unless @homepage.id == @current_page.id end |
Instance Attribute Details
#breadcrumb_items ⇒ Object
Returns the value of attribute breadcrumb_items.
22 23 24 |
# File 'app/presenters/spina/pages/breadcrumb.rb', line 22 def @breadcrumb_items end |
#context ⇒ Object
Returns the value of attribute context.
22 23 24 |
# File 'app/presenters/spina/pages/breadcrumb.rb', line 22 def context @context end |
#current_page ⇒ Object
Returns the value of attribute current_page.
22 23 24 |
# File 'app/presenters/spina/pages/breadcrumb.rb', line 22 def current_page @current_page end |
#homepage ⇒ Object
Returns the value of attribute homepage.
22 23 24 |
# File 'app/presenters/spina/pages/breadcrumb.rb', line 22 def homepage @homepage end |
#include_homepage ⇒ Object
Returns the value of attribute include_homepage.
22 23 24 |
# File 'app/presenters/spina/pages/breadcrumb.rb', line 22 def include_homepage @include_homepage end |
Instance Method Details
#to_html ⇒ Object
35 36 37 |
# File 'app/presenters/spina/pages/breadcrumb.rb', line 35 def to_html (@breadcrumb_items) end |