Sha256: 13ab8157c0dde65eb0438e0b99804fa03132cd22e97985e4453a41cb1564223a

Contents?: true

Size: 1.11 KB

Versions: 10

Compression:

Stored size: 1.11 KB

Contents

require_relative '../item'

module CCS
  module Components
    module GovUK
      class Pagination < Base
        class Item < Base
          # = GOV.UK Pagination Item tag
          #
          # This generates the HTML for the pagination item using a link tag
          #
          # @!attribute [r] href
          #   @return [String] URL for the pagination item

          class Tag < Item
            private

            attr_reader :href

            public

            # @param (see CCS::Components::GovUK::Pagination::Item)
            # @param href [String] the URL for the pagination item
            #
            # @option (see CCS::Components::GovUK::Pagination::Item)

            def initialize(href:, **options)
              super(**options)

              @href = href
            end

            # Generates the HTML for the GOV.UK Pagination item link
            #
            # @return [ActiveSupport::SafeBuffer]

            def render
              super() do
                link_to(number, href, **@options[:attributes])
              end
            end
          end
        end
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
ccs-frontend_helpers-0.3.0 lib/ccs/components/govuk/pagination/item/tag.rb
ccs-frontend_helpers-0.2.0 lib/ccs/components/govuk/pagination/item/tag.rb
ccs-frontend_helpers-0.1.2 lib/ccs/components/govuk/pagination/item/tag.rb
ccs-frontend_helpers-0.1.1 lib/ccs/components/govuk/pagination/item/tag.rb
ccs-frontend_helpers-0.1.1.rc.1 lib/ccs/components/govuk/pagination/item/tag.rb
ccs-frontend_helpers-0.1.0.rc.7 lib/ccs/components/govuk/pagination/item/tag.rb
ccs-frontend_helpers-0.1.0.rc.6 lib/ccs/components/govuk/pagination/item/tag.rb
ccs-frontend_helpers-0.1.0.rc.5 lib/ccs/components/govuk/pagination/item/tag.rb
ccs-frontend_helpers-0.1.0.rc.4 lib/ccs/components/govuk/pagination/item/tag.rb
ccs-frontend_helpers-0.1.0.rc.3 lib/ccs/components/govuk/pagination/item/tag.rb