Class: Spina::MenuPresenter

Inherits:
Object
  • Object
show all
Includes:
ActionView::Helpers::TagHelper, ActionView::Helpers::UrlHelper
Defined in:
app/presenters/spina/menu_presenter.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(collection) ⇒ MenuPresenter

Returns a new instance of MenuPresenter.



16
17
18
19
20
21
22
# File 'app/presenters/spina/menu_presenter.rb', line 16

def initialize(collection)
  @collection = collection
  @menu_tag = :nav
  @list_tag = :ul
  @list_item_tag = :li
  @include_drafts = false
end

Instance Attribute Details

#active_list_item_cssObject

Returns the value of attribute active_list_item_css.



6
7
8
# File 'app/presenters/spina/menu_presenter.rb', line 6

def active_list_item_css
  @active_list_item_css
end

#collectionObject

Returns the value of attribute collection.



6
7
8
# File 'app/presenters/spina/menu_presenter.rb', line 6

def collection
  @collection
end

#current_list_item_cssObject

Returns the value of attribute current_list_item_css.



6
7
8
# File 'app/presenters/spina/menu_presenter.rb', line 6

def current_list_item_css
  @current_list_item_css
end

#depthObject

Returns the value of attribute depth.



6
7
8
# File 'app/presenters/spina/menu_presenter.rb', line 6

def depth
  @depth
end

#include_draftsObject

Returns the value of attribute include_drafts.



6
7
8
# File 'app/presenters/spina/menu_presenter.rb', line 6

def include_drafts
  @include_drafts
end

Returns the value of attribute link_tag_css.



6
7
8
# File 'app/presenters/spina/menu_presenter.rb', line 6

def link_tag_css
  @link_tag_css
end

#list_cssObject

Returns the value of attribute list_css.



6
7
8
# File 'app/presenters/spina/menu_presenter.rb', line 6

def list_css
  @list_css
end

#list_item_cssObject

Returns the value of attribute list_item_css.



6
7
8
# File 'app/presenters/spina/menu_presenter.rb', line 6

def list_item_css
  @list_item_css
end

#list_item_tagObject

Returns the value of attribute list_item_tag.



6
7
8
# File 'app/presenters/spina/menu_presenter.rb', line 6

def list_item_tag
  @list_item_tag
end

#list_tagObject

Returns the value of attribute list_tag.



6
7
8
# File 'app/presenters/spina/menu_presenter.rb', line 6

def list_tag
  @list_tag
end

Returns the value of attribute menu_css.



6
7
8
# File 'app/presenters/spina/menu_presenter.rb', line 6

def menu_css
  @menu_css
end

Returns the value of attribute menu_id.



6
7
8
# File 'app/presenters/spina/menu_presenter.rb', line 6

def menu_id
  @menu_id
end

Returns the value of attribute menu_tag.



6
7
8
# File 'app/presenters/spina/menu_presenter.rb', line 6

def menu_tag
  @menu_tag
end

#output_bufferObject

Returns the value of attribute output_buffer.



6
7
8
# File 'app/presenters/spina/menu_presenter.rb', line 6

def output_buffer
  @output_buffer
end

Instance Method Details

#to_htmlObject



24
25
26
# File 'app/presenters/spina/menu_presenter.rb', line 24

def to_html
  render_menu(roots)
end