Class: Kiba::Extend::Transforms::Marc::Extract245Title
- Inherits:
-
Object
- Object
- Kiba::Extend::Transforms::Marc::Extract245Title
- Defined in:
- lib/kiba/extend/transforms/marc/extract_245_title.rb
Overview
Extract title fields from 245 (and/or linked 880) fields, along with :marcid value
Instance Method Summary collapse
-
#initialize(id_target: Kiba::Extend::Marc.id_target_field, title_target: :title, title_subfields: Kiba::Extend::Marc.title_part_subfields, delim: Kiba::Extend.delim, delete_non_filing: false, upcase_first_filing_char: false) ⇒ Extract245Title
constructor
A new instance of Extract245Title.
-
#process(record) ⇒ Hash{ Symbol => String, nil }
Constructor Details
#initialize(id_target: Kiba::Extend::Marc.id_target_field, title_target: :title, title_subfields: Kiba::Extend::Marc.title_part_subfields, delim: Kiba::Extend.delim, delete_non_filing: false, upcase_first_filing_char: false) ⇒ Extract245Title
Returns a new instance of Extract245Title.
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 |
# File 'lib/kiba/extend/transforms/marc/extract_245_title.rb', line 76 def initialize(id_target: Kiba::Extend::Marc.id_target_field, title_target: :title, title_subfields: Kiba::Extend::Marc.title_part_subfields, delim: Kiba::Extend.delim, delete_non_filing: false, upcase_first_filing_char: false) @id_target = id_target @title_target = title_target @title_subfields = title_subfields @delim = delim @delete_non_filing = delete_non_filing @upcase_first_filing_char = upcase_first_filing_char @idextractor = Kiba::Extend::Utils::MarcIdExtractor.new end |
Instance Method Details
#process(record) ⇒ Hash{ Symbol => String, nil }
94 95 96 97 98 99 |
# File 'lib/kiba/extend/transforms/marc/extract_245_title.rb', line 94 def process(record) id = idextractor.call(record) row = {id_target => id} row[title_target] = title_value(record) row end |