Class: CCS::Components::GovUK::Footer::Meta
- Inherits:
-
Object
- Object
- CCS::Components::GovUK::Footer::Meta
- Includes:
- ActionView::Context, ActionView::Helpers
- Defined in:
- lib/ccs/components/govuk/footer/meta.rb
Overview
GOV.UK Footer Meta
The footer meta section
Instance Method Summary collapse
-
#initialize(context:, items: nil, visually_hidden_title: nil, text: nil) ⇒ Meta
constructor
A new instance of Meta.
-
#render ⇒ ActiveSupport::SafeBuffer
Generates the HTML for the GOV.UK Footer Meta sections.
Constructor Details
#initialize(context:, items: nil, visually_hidden_title: nil, text: nil) ⇒ Meta
Returns a new instance of Meta.
34 35 36 37 38 |
# File 'lib/ccs/components/govuk/footer/meta.rb', line 34 def initialize(context:, items: nil, visually_hidden_title: nil, text: nil) @meta_links = items&.map { || Link.new(li_class: 'govuk-footer__inline-list-item', context: context, **) } @visually_hidden_title = visually_hidden_title || 'Support links' @text = text end |
Instance Method Details
#render ⇒ ActiveSupport::SafeBuffer
Generates the HTML for the GOV.UK Footer Meta sections
44 45 46 47 48 49 50 51 52 53 54 |
# File 'lib/ccs/components/govuk/footer/meta.rb', line 44 def render capture do concat(tag.h2(visually_hidden_title, class: 'govuk-visually-hidden')) if .present? concat(tag.ul(class: 'govuk-footer__inline-list') do .each { || concat(.render) } end) end concat(tag.div(text, class: 'govuk-footer__meta-custom')) if text end end |