psu-libraries/psulib_blacklight

View on GitHub
app/components/external_links/psu_collections_links_component.rb

Summary

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

module ExternalLinks
  class PsuCollectionsLinksComponent < BaseLinksComponent
    def heading
      if links.map { |l| l['url'].include?('ark:/42409/fa8') }.count(true).positive?
        'Special Collections Materials'
      else
        'View in Penn State Digital Collections'
      end
    end
  end
end