Sha256: c7f51d6129b28078173c35084ffeb8c638b593659cb2ba6c8d23fc6670d7a693

Contents?: true

Size: 1.13 KB

Versions: 10

Compression:

Stored size: 1.13 KB

Contents

module GOVUKDesignSystemFormBuilder
  module Containers
    class RadioButtonsFieldset < Base
      include Traits::Hint
      include Traits::Error

      def initialize(builder, object_name, attribute_name, hint_text:, legend:, inline:, small:, classes:, &block)
        super(builder, object_name, attribute_name)

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

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

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
govuk_design_system_formbuilder-1.1.11 lib/govuk_design_system_formbuilder/containers/radio_buttons_fieldset.rb
govuk_design_system_formbuilder-1.2.0b2 lib/govuk_design_system_formbuilder/containers/radio_buttons_fieldset.rb
govuk_design_system_formbuilder-1.2.0b1 lib/govuk_design_system_formbuilder/containers/radio_buttons_fieldset.rb
govuk_design_system_formbuilder-1.1.10 lib/govuk_design_system_formbuilder/containers/radio_buttons_fieldset.rb
govuk_design_system_formbuilder-1.1.9 lib/govuk_design_system_formbuilder/containers/radio_buttons_fieldset.rb
govuk_design_system_formbuilder-1.1.8 lib/govuk_design_system_formbuilder/containers/radio_buttons_fieldset.rb
govuk_design_system_formbuilder-1.1.7 lib/govuk_design_system_formbuilder/containers/radio_buttons_fieldset.rb
govuk_design_system_formbuilder-1.1.6 lib/govuk_design_system_formbuilder/containers/radio_buttons_fieldset.rb
govuk_design_system_formbuilder-1.1.5 lib/govuk_design_system_formbuilder/containers/radio_buttons_fieldset.rb
govuk_design_system_formbuilder-1.1.4 lib/govuk_design_system_formbuilder/containers/radio_buttons_fieldset.rb