lib/traject/extract_work_type.rb
def extract_work_type
    lambda do |record, accumulator|
      # example: njm a2200385 a 4500
      # we want "j" from that leader field
      accumulator << WORK_TYPE_MAP[record.leader.sub(/^[0-9]*/, "").slice(1)]
    end
  end
# Transfer leader field 006 into a LOC Resource Type URI
Transfer leader field 006 into a LOC Resource Type URI
Transfer leader field 006 into a LOC Resource Type URI
def extract_work_type
    lambda do |record, accumulator|
      accumulator << WORK_TYPE_MAP[record.leader.sub(/^[0-9]*/, "").slice(1)]
    end
  end
def extract_work_type lambda do | record , accumulator | accumulator << WORK_TYPE_MAP [ record . leader . sub ( / ^[0-9]* / , "" ) . slice ( 1 ) ] end end
Transfer leader field 006 into a LOC Resource Type URI
Transfer leader field 006 into a LOC Resource Type URI
# example: njm a2200385 a 4500 # we want "j" from that leader field