Class: GOVUKDesignSystemFormBuilder::Elements::Radios::FieldsetRadioButton

Inherits:
Base
  • Object
show all
Includes:
Traits::FieldsetItem, Traits::HTMLAttributes, Traits::Hint, Traits::Label
Defined in:
lib/govuk_design_system_formbuilder/elements/radios/fieldset_radio_button.rb

Instance Method Summary collapse

Methods included from Traits::FieldsetItem

#html

Methods included from Traits::HTMLAttributes

#attributes

Methods included from Traits::Hint

#hint_id

Methods inherited from Base

#field_id, #to_s

Constructor Details

#initialize(builder, object_name, attribute_name, value, label:, hint:, link_errors:, **kwargs, &block) ⇒ FieldsetRadioButton

Returns a new instance of FieldsetRadioButton.



10
11
12
13
14
15
16
17
18
19
20
# File 'lib/govuk_design_system_formbuilder/elements/radios/fieldset_radio_button.rb', line 10

def initialize(builder, object_name, attribute_name, value, label:, hint:, link_errors:, **kwargs, &block)
  super(builder, object_name, attribute_name, &block)

  @value           = value
  @label           = label
  @hint            = hint
  @link_errors     = has_errors? && link_errors
  @html_attributes = kwargs

  conditional_content(@block_content)
end