class SimpleNavigation::Renderer::Text

Renders the 'chain' of selected navigation items as simple text items, joined with an optional separator (similar to breadcrumbs, but without markup).

Public Instance Methods

render(item_container) click to toggle source
# File lib/simple_navigation/rendering/renderer/text.rb, line 8
def render(item_container)
  list(item_container).compact.join(options[:join_with] || " ")
end

Private Instance Methods

list(item_container) click to toggle source
# File lib/simple_navigation/rendering/renderer/text.rb, line 14
def list(item_container)
  item_container.items.inject([]) do |array, item|
    if item.selected?
      array + [item.name(:apply_generator => false)] + (include_sub_navigation?(item) ? list(item.sub_navigation) : [])
    else
      array
    end
  end
end