Class: GOVUKDesignSystemFormBuilder::Elements::CheckBoxes::FieldsetCheckBox

Inherits:
Base
  • Object
show all
Includes:
Traits::FieldsetItem, Traits::HTMLAttributes, Traits::Hint, Traits::Label
Defined in:
lib/govuk_design_system_formbuilder/elements/check_boxes/fieldset_check_box.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, unchecked_value, label:, hint:, link_errors:, multiple:, exclusive:, **kwargs, &block) ⇒ FieldsetCheckBox

Returns a new instance of FieldsetCheckBox.



10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/govuk_design_system_formbuilder/elements/check_boxes/fieldset_check_box.rb', line 10

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

  @value           = value
  @unchecked_value = unchecked_value
  @label           = label
  @hint            = hint
  @multiple        = multiple
  @link_errors     = link_errors
  @html_attributes = kwargs
  @exclusive       = exclusive

  conditional_content(@block_content)
end