Sha256: bb45a7226ae77bbaeb576531af36635573b5223b95556670e6c791ebe9aa5ada

Contents?: true

Size: 999 Bytes

Versions: 3

Compression:

Stored size: 999 Bytes

Contents

module GOVUKDesignSystemFormBuilder
  module Containers
    class CheckBoxesFieldset < GOVUKDesignSystemFormBuilder::Base
      def initialize(builder, object_name, attribute_name, hint_text:, legend:, small:, &block)
        super(builder, object_name, attribute_name)

        @legend        = legend
        @hint_text     = hint_text
        @small         = small
        @block_content = @builder.capture { block.call }
      end

      def html
        Containers::FormGroup.new(@builder, @object_name, @attribute_name).html do
          Containers::Fieldset.new(@builder, legend: @legend, described_by: [error_element.error_id, hint_element.hint_id]).html do
            @builder.safe_join(
              [
                hint_element.html,
                error_element.html,
                Containers::CheckBoxes.new(@builder, small: @small).html do
                  @block_content
                end
              ]
            )
          end
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
govuk_design_system_formbuilder-0.9.2 lib/govuk_design_system_formbuilder/containers/check_boxes_fieldset.rb
govuk_design_system_formbuilder-0.9.1 lib/govuk_design_system_formbuilder/containers/check_boxes_fieldset.rb
govuk_design_system_formbuilder-0.9.0 lib/govuk_design_system_formbuilder/containers/check_boxes_fieldset.rb