psu-libraries/psulib_blacklight

View on GitHub
app/components/browse/page_size_selector.rb

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
# frozen_string_literal: true

module Browse
  class PageSizeSelector < ViewComponent::Base
    include Paths

    def link_path(length)
      browse_path(merge_params(length: length))
    end

    private

      def merge_params(opts)
        params
          .slice(:prefix, :page, :starting, :ending, :nearby, :classification)
          .merge(opts)
      end
  end
end