Sha256: 4d9c7446e3a30db63256b3df180766953678bfd265a38f20a7a3bc444b99c150

Contents?: true

Size: 647 Bytes

Versions: 3

Compression:

Stored size: 647 Bytes

Contents

module GOVUKDesignSystemFormBuilder
  module Elements
    module CheckBoxes
      class Hint < GOVUKDesignSystemFormBuilder::Base
        def initialize(builder, object_name, attribute_name, hint_text, value:)
          super(builder, object_name, attribute_name)

          @value     = value
          @hint_text = hint_text
        end

        def html
          return nil if @hint_text.blank?

          tag.span(@hint_text, class: hint_classes, id: id)
        end

        def id
          hint_id
        end

      private

        def hint_classes
          %w(govuk-hint govuk-checkboxes__hint)
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
govuk_design_system_formbuilder-1.0.1 lib/govuk_design_system_formbuilder/elements/check_boxes/hint.rb
govuk_design_system_formbuilder-1.0.0 lib/govuk_design_system_formbuilder/elements/check_boxes/hint.rb
govuk_design_system_formbuilder-0.9.8 lib/govuk_design_system_formbuilder/elements/check_boxes/hint.rb