Class: CCS::Components::GovUK::Field::Inputs::Item::Radio
- Inherits:
-
CCS::Components::GovUK::Field::Inputs::Item
- Object
- Base
- CCS::Components::GovUK::Field::Inputs::Item
- CCS::Components::GovUK::Field::Inputs::Item::Radio
- Defined in:
- lib/ccs/components/govuk/field/inputs/item/radio.rb,
lib/ccs/components/govuk/field/inputs/item/radio/tag.rb,
lib/ccs/components/govuk/field/inputs/item/radio/form.rb
Overview
GOV.UK Field Inputs Radio
This is used to generate an individual radio item
Defined Under Namespace
Constant Summary collapse
- DEFAULT_ATTRIBUTES =
The default attributes for the radio
{ class: 'govuk-radios__input' }.freeze
- ITEM_TYPE =
The type of the input item
'radios'.freeze
Instance Method Summary collapse
-
#initialize(attribute:, label:, **options) ⇒ Radio
constructor
label [Hash] attributes for the radio label, see Label#initialize for more details.
Methods inherited from CCS::Components::GovUK::Field::Inputs::Item
Constructor Details
#initialize(attribute:, label:, **options) ⇒ Radio
label [Hash] attributes for the radio label, see Label#initialize for more details.
19 20 21 22 23 |
# File 'lib/ccs/components/govuk/field/inputs/item/radio.rb', line 19 def initialize(attribute:, label:, **) super(attribute: attribute, item_class: 'govuk-radios__item', **) label[:classes] = "govuk-radios__label #{label[:classes]}".rstrip end |