class GovukPublishingComponents::Presenters::ContentBreadcrumbsBasedOnTopic
Attributes
content_item[R]
Public Class Methods
call(content_item)
click to toggle source
# File lib/govuk_publishing_components/presenters/content_breadcrumbs_based_on_topic.rb, line 4 def self.call(content_item) new(content_item).breadcrumbs end
new(content_item)
click to toggle source
# File lib/govuk_publishing_components/presenters/content_breadcrumbs_based_on_topic.rb, line 10 def initialize(content_item) @content_item = content_item end
Public Instance Methods
first_topic()
click to toggle source
# File lib/govuk_publishing_components/presenters/content_breadcrumbs_based_on_topic.rb, line 29 def first_topic topics.first end
topics()
click to toggle source
# File lib/govuk_publishing_components/presenters/content_breadcrumbs_based_on_topic.rb, line 33 def topics @topics ||= content_item.dig("links", "topics") end