Module: Traject::Macros::MarcFormats

Defined in:
lib/traject/macros/marc_format_classifier.rb

Overview

To use the marc_format macro, in your configuration file:

require 'traject/macros/marc_format_classifier'
extend Traject::Macros::MarcFormats

to_field "format", marc_formats

See also MarcClassifier which can be used directly for a bit more control.

Instance Method Summary collapse

Instance Method Details

#marc_formatsObject

very opionated macro that just adds a grab bag of format/genre/types from our own custom vocabulary, all into one field. You may want to build your own from MarcFormatClassifier functions instead.



17
18
19
20
21
# File 'lib/traject/macros/marc_format_classifier.rb', line 17

def marc_formats
  lambda do |record, accumulator|
    accumulator.concat Traject::Macros::MarcFormatClassifier.new(record).formats
  end
end