class GovukNavigationHelpers::TaxonomySidebar

Public Class Methods

new(content_item) click to toggle source
# File lib/govuk_navigation_helpers/taxonomy_sidebar.rb, line 6
def initialize(content_item)
  @content_item = ContentItem.new content_item
end

Public Instance Methods

sidebar() click to toggle source

Private Instance Methods

collections() click to toggle source
# File lib/govuk_navigation_helpers/taxonomy_sidebar.rb, line 37
def collections
  links = @content_item.related_collections
  links.map do |link|
    {
      path: link["base_path"],
      text: link["title"]
    }
  end
end