class GovukPublishingComponents::AppHelpers::TaxonBreadcrumbs::ContentItem
Attributes
content_item[R]
Public Class Methods
new(content_item)
click to toggle source
# File lib/govuk_publishing_components/app_helpers/taxon_breadcrumbs.rb, line 50 def initialize(content_item) @content_item = content_item end
Public Instance Methods
base_path()
click to toggle source
# File lib/govuk_publishing_components/app_helpers/taxon_breadcrumbs.rb, line 70 def base_path content_item.fetch("base_path") end
parent_taxon()
click to toggle source
# File lib/govuk_publishing_components/app_helpers/taxon_breadcrumbs.rb, line 54 def parent_taxon @parent_taxon ||= begin parent_content_item = content_item.dig("links", "parent_taxons", 0) ContentItem.new(parent_content_item) unless parent_content_item.nil? end end
phase_is_live?(taxon)
click to toggle source
# File lib/govuk_publishing_components/app_helpers/taxon_breadcrumbs.rb, line 62 def phase_is_live?(taxon) taxon["phase"] == "live" end
title()
click to toggle source
# File lib/govuk_publishing_components/app_helpers/taxon_breadcrumbs.rb, line 66 def title content_item.fetch("title") end