Class: CCS::Components::GovUK::SummaryList::Card::Title
- Defined in:
- lib/ccs/components/govuk/summary_list/card/title.rb
Overview
GOV.UK Summary list card title
Constant Summary collapse
- DEFAULT_ATTRIBUTES =
The default attributes for the summary list card title
{ class: 'govuk-summary-card__title' }.freeze
Instance Method Summary collapse
-
#initialize(text:, heading_level: '2', **options) ⇒ Title
constructor
A new instance of Title.
-
#render ⇒ ActiveSupport::SafeBuffer
Generates the HTML for the GOV.UK Summary list card title.
Constructor Details
#initialize(text:, heading_level: '2', **options) ⇒ Title
Returns a new instance of Title.
28 29 30 31 32 33 |
# File 'lib/ccs/components/govuk/summary_list/card/title.rb', line 28 def initialize(text:, heading_level: '2', **) super(**) @text = text @heading_level = heading_level end |
Instance Method Details
#render ⇒ ActiveSupport::SafeBuffer
Generates the HTML for the GOV.UK Summary list card title
39 40 41 |
# File 'lib/ccs/components/govuk/summary_list/card/title.rb', line 39 def render tag.send("h#{heading_level}", text, class: @options[:attributes][:class]) end |