Class: GovukPublishingComponents::Presenters::ContentBreadcrumbsBasedOnOrganisations

Inherits:
Object
  • Object
show all
Defined in:
lib/govuk_publishing_components/presenters/content_breadcrumbs_based_on_organisations.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(content_item) ⇒ ContentBreadcrumbsBasedOnOrganisations

Returns a new instance of ContentBreadcrumbsBasedOnOrganisations.



9
10
11
# File 'lib/govuk_publishing_components/presenters/content_breadcrumbs_based_on_organisations.rb', line 9

def initialize(content_item)
  @content_item = ContentItem.new(content_item)
end

Class Method Details

.call(content_item) ⇒ Object



5
6
7
# File 'lib/govuk_publishing_components/presenters/content_breadcrumbs_based_on_organisations.rb', line 5

def self.call(content_item)
  new(content_item).breadcrumbs
end

Instance Method Details



13
14
15
16
17
18
19
# File 'lib/govuk_publishing_components/presenters/content_breadcrumbs_based_on_organisations.rb', line 13

def breadcrumbs
  [
    { title: "Home", url: "/" },
    { title: "Organisations", url: "/government/organisations" },
    *organisation_breadcrumbs_items,
  ]
end