Class: AnyStyle::Normalizer::Journal

Inherits:
AnyStyle::Normalizer show all
Defined in:
lib/anystyle/normalizer/journal.rb

Instance Attribute Summary

Attributes inherited from AnyStyle::Normalizer

#keys, #skip

Instance Method Summary collapse

Methods inherited from AnyStyle::Normalizer

#append, #detect_language, #detect_scripts, #doi_extract, #each_value, #initialize, #keys_for, #map_values, #name, #skip?

Constructor Details

This class inherits a constructor from AnyStyle::Normalizer

Instance Method Details

#normalize(item, **opts) ⇒ Object



4
5
6
7
8
9
10
11
# File 'lib/anystyle/normalizer/journal.rb', line 4

def normalize(item, **opts)
  if item.key?(:journal)
    item[:type] = 'article-journal'
    item[:journal].each { |journal| append item, :'container-title', journal }
    item.delete(:journal)
  end
  item
end