Sha256: 924b02feb35bff4384672871e0af8a47c4e761ee8992db24803b340526a93d4c

Contents?: true

Size: 1015 Bytes

Versions: 1

Compression:

Stored size: 1015 Bytes

Contents

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

        @inline        = inline
        @small         = small
        @legend        = legend
        @hint_text     = hint_text
        @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::Radios.new(@builder, inline: @inline, small: @small).html do
                @block_content
              end
            ])
          end
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
govuk_design_system_formbuilder-0.7.10 lib/govuk_design_system_formbuilder/containers/radio_buttons_fieldset.rb