Skip to content

Commit

Permalink
Refactor, rebase and add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Genia Kazymova committed Dec 12, 2023
1 parent 4364992 commit 87c36ab
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions lib/trln_argon/solr_document/highwire_field_mapping.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
# frozen_string_literal: true

module TrlnArgon
module SolrDocument
module HighwireFieldMapping
# https://raw.githubusercontent.com/zotero/translators/db2771d52d89d1480ff98efbd6968565893f2184/Embedded%20Metadata.js
MAPPING = {
'title_main' => 'citation_title',
'publication_year_sort' => 'citation_publication_date',
Expand All @@ -26,11 +25,11 @@ def highwire_metadata_tags

private

def process_docvalue(result, metadata_key, docvalue)
def process_docvalue(result, key, docvalue)
if docvalue.is_a?(Array)
docvalue.each { |dv| result << [metadata_key, dv] }
docvalue.each { |dv| result << [key, dv] }
else
result << [metadata_key, docvalue]
result << [key, docvalue]
end
end

Expand Down

0 comments on commit 87c36ab

Please sign in to comment.