Class: GovukNavigationHelpers::NavigationHelper
- Inherits:
-
Object
- Object
- GovukNavigationHelpers::NavigationHelper
- Defined in:
- lib/govuk_navigation_helpers.rb
Instance Method Summary collapse
-
#breadcrumbs ⇒ Hash
Generate a breadcrumb trail.
-
#initialize(content_item) ⇒ NavigationHelper
constructor
A new instance of NavigationHelper.
-
#related_items ⇒ Hash
Generate a related items payload.
-
#related_navigation_sidebar ⇒ Hash
Generate a payload containing related navigation sidebar data.
-
#taxon_breadcrumbs ⇒ Hash
Generate a breadcrumb trail for a taxon, using the taxon_parent link field.
-
#taxonomy_sidebar ⇒ Hash
Generate a payload containing taxon sidebar data.
Constructor Details
#initialize(content_item) ⇒ NavigationHelper
Returns a new instance of NavigationHelper.
20 21 22 |
# File 'lib/govuk_navigation_helpers.rb', line 20 def initialize(content_item) @content_item = content_item end |
Instance Method Details
#breadcrumbs ⇒ Hash
Generate a breadcrumb trail
28 29 30 |
# File 'lib/govuk_navigation_helpers.rb', line 28 def Breadcrumbs.new(content_item). end |
#related_items ⇒ Hash
Generate a related items payload
53 54 55 |
# File 'lib/govuk_navigation_helpers.rb', line 53 def RelatedItems.new(content_item). end |
#related_navigation_sidebar ⇒ Hash
Generate a payload containing related navigation sidebar data. Intended for use with the related navigation component
62 63 64 |
# File 'lib/govuk_navigation_helpers.rb', line 62 def RelatedNavigationSidebar.new(content_item). end |
#taxon_breadcrumbs ⇒ Hash
Generate a breadcrumb trail for a taxon, using the taxon_parent link field
36 37 38 |
# File 'lib/govuk_navigation_helpers.rb', line 36 def TaxonBreadcrumbs.new(content_item). end |
#taxonomy_sidebar ⇒ Hash
Generate a payload containing taxon sidebar data. Intended for use with the related items component.
45 46 47 |
# File 'lib/govuk_navigation_helpers.rb', line 45 def TaxonomySidebar.new(content_item). end |