app/searchers/quick_search/world_cat_discovery_api_article_searcher.rb
# Returns an OpenUrlBuilder populated with information from the given
# bib and link, or nil if an error occurs extracting the bib information
Returns an OpenUrlBuilder populated with information from the given
bib and link, or nil if an error occurs extracting the bib information
Returns an OpenUrlBuilder populated with information from the given bib and link or nil if an error occurs extracting the bib information
def open_url_builder(bib, link) 
      best_type = WorldCat::Discovery::Bib.choose_best_type(bib)
      return nil unless best_type.is_a? WorldCat::Discovery::Article
      article = best_type
      builder = UmdOpenUrl::Builder.new(link)
      begin
        builder.issn(article&.periodical&.issn)
        builder.volume(article&.volume&.volume_number)
        builder.issue(article&.issue&.issue_number)
        builder.start_page(article&.page_start)
        builder.publication_date(article&.date_published)
      rescue StandardError
        return nil
      end
      builder
    end
def open_url_builder ( bib , link ) best_type = WorldCat :: Discovery :: Bib . choose_best_type ( bib ) return nil unless best_type . is_a? WorldCat :: Discovery :: Article article = best_type builder = UmdOpenUrl :: Builder . new ( link ) begin builder . issn ( article &. periodical &. issn ) builder . volume ( article &. volume &. volume_number ) builder . issue ( article &. issue &. issue_number ) builder . start_page ( article &. page_start ) builder . publication_date ( article &. date_published ) rescue StandardError return nil end builder end
Returns an OpenUrlBuilder populated with information from the given
bib and link, or nil if an error occurs extracting the bib information
Returns an OpenUrlBuilder populated with information from the given bib and link or nil if an error occurs extracting the bib information
# rubocop:disable Metrics/AbcSize, Metrics/MethodLength # WorldCat code doesn't always check for nil, so wrap in begin/rescue # so that we can just return nil if an error occurs.
bib
link