Class: CCS::Components::GovUK::SummaryList::Row::Value

Inherits:
Base
  • Object
show all
Defined in:
lib/ccs/components/govuk/summary_list/row/value.rb

Overview

GOV.UK Summary list row value

Constant Summary collapse

DEFAULT_ATTRIBUTES =

The default attributes for the summary list row value

{ class: 'govuk-summary-list__value' }.freeze

Instance Method Summary collapse

Constructor Details

#initialize(text:, **options) ⇒ Value

Returns a new instance of Value.

Parameters:

  • text (String)

    Text for the summary list row value

  • options (Hash)

    options that will be used in customising the HTML

Options Hash (**options):

  • :classes (String)

    additional CSS classes for the summary list row value HTML



25
26
27
28
29
# File 'lib/ccs/components/govuk/summary_list/row/value.rb', line 25

def initialize(text:, **options)
  super(**options)

  @text = text
end

Instance Method Details

#renderActiveSupport::SafeBuffer

Generates the HTML for the GOV.UK Summary list row value

Returns:

  • (ActiveSupport::SafeBuffer)


35
36
37
# File 'lib/ccs/components/govuk/summary_list/row/value.rb', line 35

def render
  tag.dd(text, class: @options[:attributes][:class])
end