Class: GOVUKDesignSystemFormBuilder::Containers::RadioButtonsFieldset

Inherits:
Base
  • Object
show all
Includes:
Traits::Error, Traits::Hint
Defined in:
lib/govuk_design_system_formbuilder/containers/radio_buttons_fieldset.rb

Instance Method Summary collapse

Methods included from Traits::Error

#error_id

Methods included from Traits::Hint

#hint_id

Methods inherited from Base

#field_id, #to_s

Constructor Details

#initialize(builder, object_name, attribute_name, hint:, legend:, caption:, inline:, small:, form_group:, **kwargs, &block) ⇒ RadioButtonsFieldset

Returns a new instance of RadioButtonsFieldset.



7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/govuk_design_system_formbuilder/containers/radio_buttons_fieldset.rb', line 7

def initialize(builder, object_name, attribute_name, hint:, legend:, caption:, inline:, small:, form_group:, **kwargs, &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
  @form_group      = form_group
  @html_attributes = kwargs
end

Instance Method Details

#htmlObject



21
22
23
24
25
26
27
# File 'lib/govuk_design_system_formbuilder/containers/radio_buttons_fieldset.rb', line 21

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