Sha256: fd86843e0aa096f980b1d6f861fe1c32209c402d06e7f1aebb5bdfc1b796d06e

Contents?: true

Size: 492 Bytes

Versions: 9

Compression:

Stored size: 492 Bytes

Contents

module GOVUKDesignSystemFormBuilder
  module Traits
    module Caption
    private

      def caption_element
        @caption_element ||= Elements::Caption.new(@builder, @object_name, @attribute_name, **caption_options)
      end

      def caption_options
        { text: nil }.merge({ text: caption_text, size: caption_size }.compact)
      end

      def caption_text
        @caption&.dig(:text)
      end

      def caption_size
        @caption&.dig(:size)
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
govuk_design_system_formbuilder-1.2.9 lib/govuk_design_system_formbuilder/traits/caption.rb
govuk_design_system_formbuilder-2.0.0b1 lib/govuk_design_system_formbuilder/traits/caption.rb
govuk_design_system_formbuilder-1.2.7 lib/govuk_design_system_formbuilder/traits/caption.rb
govuk_design_system_formbuilder-1.2.6 lib/govuk_design_system_formbuilder/traits/caption.rb
govuk_design_system_formbuilder-1.2.5 lib/govuk_design_system_formbuilder/traits/caption.rb
govuk_design_system_formbuilder-1.2.4 lib/govuk_design_system_formbuilder/traits/caption.rb
govuk_design_system_formbuilder-1.2.3 lib/govuk_design_system_formbuilder/traits/caption.rb
govuk_design_system_formbuilder-1.2.2 lib/govuk_design_system_formbuilder/traits/caption.rb
govuk_design_system_formbuilder-1.2.1 lib/govuk_design_system_formbuilder/traits/caption.rb