lib/ccs/components/govuk/field/inputs/item/divider.rb in ccs-frontend_helpers-0.1.0.rc.2 vs lib/ccs/components/govuk/field/inputs/item/divider.rb in ccs-frontend_helpers-0.1.0.rc.3

- old
+ new

@@ -1,45 +1,47 @@ require 'action_view' -module CCS::Components - module GovUK - class Field < Base - class Inputs < Field - class Item < Base - # = GOV.UK Field Inputs item divider - # - # The divider for input items e.g. {CCS::Components::GovUK::Field::Inputs::Checkboxes Checkboxes} or {CCS::Components::GovUK::Field::Inputs::Radios Radios} - # - # @!attribute [r] text - # @return [String] Text for the divider - # @!attribute [r] type - # @return [String] The type of the item +module CCS + module Components + module GovUK + class Field < Base + class Inputs < Field + class Item < Base + # = GOV.UK Field Inputs item divider + # + # The divider for input items e.g. {CCS::Components::GovUK::Field::Inputs::Checkboxes Checkboxes} or {CCS::Components::GovUK::Field::Inputs::Radios Radios} + # + # @!attribute [r] text + # @return [String] Text for the divider + # @!attribute [r] type + # @return [String] The type of the item - class Divider - include ActionView::Context - include ActionView::Helpers + class Divider + include ActionView::Context + include ActionView::Helpers - private + private - attr_reader :text, :type + attr_reader :text, :type - public + public - # @param divider [String] the text for the divider - # @param type [String] the type of the item divider. - # One of +'checkboxes'+ or +'radios'+ + # @param divider [String] the text for the divider + # @param type [String] the type of the item divider. + # One of +'checkboxes'+ or +'radios'+ - def initialize(divider:, type:) - @text = divider - @type = type - end + def initialize(divider:, type:) + @text = divider + @type = type + end - # Generates the HTML for an item divider - # - # @return [ActiveSupport::SafeBuffer] + # Generates the HTML for an item divider + # + # @return [ActiveSupport::SafeBuffer] - def render - tag.div(text, class: "govuk-#{type}__divider") + def render + tag.div(text, class: "govuk-#{type}__divider") + end end end end end end