Class: CCS::Components::GovUK::Field::Inputs::Item::Divider

Inherits:
Object
  • Object
show all
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

Constructor Details

#initialize(divider:, type:) ⇒ Divider

Returns a new instance of Divider.

Parameters:

  • divider (String)

    the text for the divider

  • type (String)

    the type of the item divider. One of ‘checkboxes’ or ‘radios’



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

#renderActiveSupport::SafeBuffer

Generates the HTML for an item divider

Returns:

  • (ActiveSupport::SafeBuffer)


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