Sha256: 7647b43f74dffd1fc7808a33c911c9bde8fc8275d61779fc5e66ec5567894ef6
Contents?: true
Size: 624 Bytes
Versions: 12
Compression:
Stored size: 624 Bytes
Contents
module RocketNavigation module Renderer # Renders the 'chain' of selected navigation items as simple text items, # joined with an optional separator (similar to breadcrumbs, but without # markup). class Text < RocketNavigation::Renderer::Base def render(item_container) list(item_container).compact.join(options[:join_with] || ' ') end private def list(item_container) item_container.items.keep_if(&:selected?).map do |item| [item.name] + (include_sub_navigation?(item) ? list(item.sub_navigation) : []) end end end end end
Version data entries
12 entries across 12 versions & 1 rubygems