lib/traject/extract_issue_number.rb
def extract_issue_number
    a_extractor = Traject::MarcExtractor.new("028|0*|a")
    b_extractor = Traject::MarcExtractor.new("028|0*|b")
    lambda do |record, accumulator|
      fields = [
        a_extractor.extract(record).compact.first,
        b_extractor.extract(record).compact.first,
      ].compact

      next if fields.empty?
      accumulator << fields.join(" : ")
    end
  end
# Transform field 028 with "0" in the indicator1 field.
# Format "$b : $a"
Transform field 028 with "0" in the indicator1 field.
Transform field 028 with " 0 " in the indicator1 field .
def extract_issue_number
    a_extractor = Traject::MarcExtractor.new("028|0*|a")
    b_extractor = Traject::MarcExtractor.new("028|0*|b")
    lambda do |record, accumulator|
      fields = [
        a_extractor.extract(record).compact.first,
        b_extractor.extract(record).compact.first,
      ].compact
      next if fields.empty?
      accumulator << fields.join(" : ")
    end
  end
def extract_issue_number a_extractor = Traject :: MarcExtractor . new ( "028|0*|a" ) b_extractor = Traject :: MarcExtractor . new ( "028|0*|b" ) lambda do | record , accumulator | fields = [ a_extractor . extract ( record ) . compact . first , b_extractor . extract ( record ) . compact . first , ] . compact next if fields . empty? accumulator << fields . join ( " : " ) end end
Transform field 028 with "0" in the indicator1 field.
Transform field 028 with " 0 " in the indicator1 field .