Sha256: 3c73d8c2c9724eff202988d097a4690b25cb490a28055cdfeb4ec813f5285c12
Contents?: true
Size: 1.25 KB
Versions: 18
Compression:
Stored size: 1.25 KB
Contents
module GOVUKDesignSystemFormBuilder module Containers class RadioButtonsFieldset < Base include Traits::Hint include Traits::Error def initialize(builder, object_name, attribute_name, hint:, legend:, caption:, inline:, small:, classes:, form_group:, &block) fail LocalJumpError, 'no block given' unless block_given? super(builder, object_name, attribute_name, &block) @inline = inline @small = small @legend = legend @caption = caption @hint = hint @classes = classes @form_group = form_group end def html Containers::FormGroup.new(*bound, **@form_group).html do Containers::Fieldset.new(*bound, **fieldset_options).html do safe_join([hint_element, error_element, radios]) end end end private def fieldset_options { legend: @legend, caption: @caption, described_by: [error_element.error_id, hint_element.hint_id] } end def radios Containers::Radios.new(@builder, inline: @inline, small: @small, classes: @classes).html do @block_content end end end end end
Version data entries
18 entries across 18 versions & 1 rubygems