lib/traject/extract_contributors.rb
def extract_contributors
    lambda do |record, accumulator|
      fields = record.fields.select { |f| TAGS.include?(f.tag) }

      contributors = {}
      fields.each do |field|
        keys = roles_for(field)
        value = data_for(field)
        keys.each do |key|
          contributors[key] ||= []
          contributors[key] << value
        end
      end

      accumulator << contributors
    end
  end
# For wax cylinder recordings, we want to capture
# contributor data from fields 100, 110, 700, and 710
# of the MARC record.
For wax cylinder recordings, we want to capture
contributor data from fields 100, 110, 700, and 710
of the MARC record.
For wax cylinder recordings we want to capture contributor data from fields 100 110 700 and 710 of the MARC record .
def extract_contributors
    lambda do |record, accumulator|
      fields = record.fields.select { |f| TAGS.include?(f.tag) }
      contributors = {}
      fields.each do |field|
        keys = roles_for(field)
        value = data_for(field)
        keys.each do |key|
          contributors[key] ||= []
          contributors[key] << value
        end
      end
      accumulator << contributors
    end
  end
def extract_contributors lambda do | record , accumulator | fields = record . fields . select { | f | TAGS . include? ( f . tag ) } contributors = { } fields . each do | field | keys = roles_for ( field ) value = data_for ( field ) keys . each do | key | contributors [ key ] ||= [ ] contributors [ key ] << value end end accumulator << contributors end end
For wax cylinder recordings, we want to capture
contributor data from fields 100, 110, 700, and 710
of the MARC record.
For wax cylinder recordings we want to capture contributor data from fields 100 110 700 and 710 of the MARC record .