Class: CCS::Components::GovUK::Footer::Link
- Defined in:
- lib/ccs/components/govuk/footer/link.rb
Overview
GOV.UK Footer link
The individual footer footer link item
Constant Summary
Constants inherited from Base
Instance Method Summary collapse
-
#initialize(text:, href:, li_class:, **options) ⇒ Link
constructor
A new instance of Link.
-
#render ⇒ ActiveSupport::SafeBuffer
Generates the HTML for the GOV.UK Footer link.
Constructor Details
#initialize(text:, href:, li_class:, **options) ⇒ Link
Returns a new instance of Link.
32 33 34 35 36 37 38 |
# File 'lib/ccs/components/govuk/footer/link.rb', line 32 def initialize(text:, href:, li_class:, **) super(**) @text = text @href = href @li_class = li_class end |
Instance Method Details
#render ⇒ ActiveSupport::SafeBuffer
Generates the HTML for the GOV.UK Footer link
44 45 46 47 48 49 50 |
# File 'lib/ccs/components/govuk/footer/link.rb', line 44 def render tag.li(class: li_class) do [:attributes][:class] = 'govuk-footer__link' link_to(text, href, **[:attributes]) end end |