Class: CCS::Components::GovUK::Field::Inputs::Item::Divider
- Inherits:
-
Object
- Object
- CCS::Components::GovUK::Field::Inputs::Item::Divider
- Includes:
- ActionView::Context, ActionView::Helpers
- Defined in:
- lib/ccs/components/govuk/field/inputs/item/divider.rb
Overview
GOV.UK Field Inputs item divider
The divider for input items e.g. Checkboxes or Radios
Instance Method Summary collapse
-
#initialize(divider:, type:) ⇒ Divider
constructor
A new instance of Divider.
-
#render ⇒ ActiveSupport::SafeBuffer
Generates the HTML for an item divider.
Constructor Details
#initialize(divider:, type:) ⇒ Divider
Returns a new instance of Divider.
32 33 34 35 |
# File 'lib/ccs/components/govuk/field/inputs/item/divider.rb', line 32 def initialize(divider:, type:) @text = divider @type = type end |
Instance Method Details
#render ⇒ ActiveSupport::SafeBuffer
Generates the HTML for an item divider
41 42 43 |
# File 'lib/ccs/components/govuk/field/inputs/item/divider.rb', line 41 def render tag.div(text, class: "govuk-#{type}__divider") end |