lib/psulib_traject/processors/media_type.rb
def resolve_007
      [].tap do |results|
        Traject::MarcExtractor.cached('007').collect_matching_lines(record) do |field, _spec, _extractor|
          results << case field.value[0]
                     when 'g'
                       'Slide' if field.value[1] == 's'
                     when 'k'
                       'Photo' if field.value[1] == 'h'
                     when 'm'
                       'Film'
                     when 'r'
                       'Remote-sensing image'
                     when 's'
                       resolve_007_byte1(field) if in_the_library?
                     when 'v'
                       resolve_007_byte4(field)
                     end
        end
      end
    end
# Check 007 media types, a record may have multiple 007s
Check 007 media types, a record may have multiple 007s
Check 007 media types a record may have multiple 007s
def resolve_007
      [].tap do |results|
        Traject::MarcExtractor.cached('007').collect_matching_lines(record) do |field, _spec, _extractor|
          results << case field.value[0]
                     when 'g'
                       'Slide' if field.value[1] == 's'
                     when 'k'
                       'Photo' if field.value[1] == 'h'
                     when 'm'
                       'Film'
                     when 'r'
                       'Remote-sensing image'
                     when 's'
                       resolve_007_byte1(field) if in_the_library?
                     when 'v'
                       resolve_007_byte4(field)
                     end
        end
      end
    end
def resolve_007 [ ] . tap do | results | Traject :: MarcExtractor . cached ( '007' ) . collect_matching_lines ( record ) do | field , _spec , _extractor | results << case field . value [ 0 ] when 'g' 'Slide' if field . value [ 1 ] == 's' when 'k' 'Photo' if field . value [ 1 ] == 'h' when 'm' 'Film' when 'r' 'Remote-sensing image' when 's' resolve_007_byte1 ( field ) if in_the_library? when 'v' resolve_007_byte4 ( field ) end end end end
Check 007 media types, a record may have multiple 007s
Check 007 media types a record may have multiple 007s