Sha256: 7f2daefc413671e03a8cb5255cee80be571927bb526c6885e4475ce81cd4f3cd

Contents?: true

Size: 1.19 KB

Versions: 20

Compression:

Stored size: 1.19 KB

Contents

require_relative '../../../base'

module CCS
  module Components
    module GovUK
      class SummaryList < Base
        class Row < Base
          # = GOV.UK Summary list row key
          #
          # @!attribute [r] text
          #   @return [String] Text for the summary list row key

          class Key < Base
            private

            attr_reader :text

            public

            # @param text [String] Text for the summary list row key
            # @param options [Hash] options that will be used in customising the HTML
            #
            # @option options [String] :classes additional CSS classes for the summary list row key HTML

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

              @text = text
            end

            # Generates the HTML for the GOV.UK Summary list row key
            #
            # @return [ActiveSupport::SafeBuffer]

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

            # The default attributes for the summary list row key

            DEFAULT_ATTRIBUTES = { class: 'govuk-summary-list__key' }.freeze
          end
        end
      end
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
ccs-frontend_helpers-2.1.0 lib/ccs/components/govuk/summary_list/row/key.rb
ccs-frontend_helpers-2.0.0 lib/ccs/components/govuk/summary_list/row/key.rb
ccs-frontend_helpers-1.2.0 lib/ccs/components/govuk/summary_list/row/key.rb
ccs-frontend_helpers-1.1.2 lib/ccs/components/govuk/summary_list/row/key.rb
ccs-frontend_helpers-1.1.1 lib/ccs/components/govuk/summary_list/row/key.rb
ccs-frontend_helpers-1.1.0 lib/ccs/components/govuk/summary_list/row/key.rb
ccs-frontend_helpers-1.1.0.beta0 lib/ccs/components/govuk/summary_list/row/key.rb
ccs-frontend_helpers-1.0.0 lib/ccs/components/govuk/summary_list/row/key.rb
ccs-frontend_helpers-0.5.0.beta1 lib/ccs/components/govuk/summary_list/row/key.rb
ccs-frontend_helpers-0.5.0.beta0 lib/ccs/components/govuk/summary_list/row/key.rb
ccs-frontend_helpers-0.3.0 lib/ccs/components/govuk/summary_list/row/key.rb
ccs-frontend_helpers-0.2.0 lib/ccs/components/govuk/summary_list/row/key.rb
ccs-frontend_helpers-0.1.2 lib/ccs/components/govuk/summary_list/row/key.rb
ccs-frontend_helpers-0.1.1 lib/ccs/components/govuk/summary_list/row/key.rb
ccs-frontend_helpers-0.1.1.rc.1 lib/ccs/components/govuk/summary_list/row/key.rb
ccs-frontend_helpers-0.1.0.rc.7 lib/ccs/components/govuk/summary_list/row/key.rb
ccs-frontend_helpers-0.1.0.rc.6 lib/ccs/components/govuk/summary_list/row/key.rb
ccs-frontend_helpers-0.1.0.rc.5 lib/ccs/components/govuk/summary_list/row/key.rb
ccs-frontend_helpers-0.1.0.rc.4 lib/ccs/components/govuk/summary_list/row/key.rb
ccs-frontend_helpers-0.1.0.rc.3 lib/ccs/components/govuk/summary_list/row/key.rb