Class: Kiba::Extend::Transforms::Marc::ExtractMeetingNameData

Inherits:
ExtractBaseNameData show all
Defined in:
lib/kiba/extend/transforms/marc/extract_meeting_name_data.rb

Overview

Extract :marcid and meeting name data (name, role term, role code, source field tag) from fields containing structured name data

Examples:

# =001  008000714-7
# =711  2\$aAssociation of Child Psychology Annual Conference.
#          $eSubcommittee.$jsponsor$jvenue
rec = get_marc_record(index: 6)
xform = Marc::ExtractMeetingNameData.new
results = []
xform.process(rec){ |row| results << row }
expect(results.length).to eq(1)
row = {:sourcefield=>"711",
       :name=>"Association of Child Psychology Annual "\
       "Conference. Subcommittee",
       :nametype=>"meeting", :role_code=>"",
       :role_term=>"sponsor|venue", :marcid=>"008000714-7"}
expect(results.first).to eq(row)

Since:

  • 4.0.0

Instance Method Summary collapse

Methods inherited from ExtractBaseNameData

#process

Methods included from FieldLinkable

#select_fields

Constructor Details

#initialize(name_type: "meeting", name_fields: Kiba::Extend::Marc.meeting_data_tags, name_subfields: Kiba::Extend::Marc.meeting_name_part_subfields, role_code_subfields: Kiba::Extend::Marc.meeting_role_code_subfields, role_term_subfields: Kiba::Extend::Marc.meeting_role_term_subfields) ⇒ ExtractMeetingNameData

Returns a new instance of ExtractMeetingNameData.

Parameters:

  • name_type (String) (defaults to: "meeting")

    to insert into name_type_target field

  • name_fields (Array<String>) (defaults to: Kiba::Extend::Marc.meeting_data_tags)

    MARC fields from which name data will be extracted

  • name_subfields (Array<String>) (defaults to: Kiba::Extend::Marc.meeting_name_part_subfields)

    subfields to extract as part of name value.

  • role_code_subfields (Array<String>) (defaults to: Kiba::Extend::Marc.meeting_role_code_subfields)

    subfields to extract as role code value

  • role_term_subfields (Array<String>) (defaults to: Kiba::Extend::Marc.meeting_role_term_subfields)

    subfields to extract as role term value

Since:

  • 4.0.0



39
40
41
42
43
44
45
46
47
48
# File 'lib/kiba/extend/transforms/marc/extract_meeting_name_data.rb', line 39

def initialize(name_type: "meeting",
  name_fields: Kiba::Extend::Marc.meeting_data_tags,
  name_subfields:
  Kiba::Extend::Marc.meeting_name_part_subfields,
  role_code_subfields:
  Kiba::Extend::Marc.meeting_role_code_subfields,
  role_term_subfields:
  Kiba::Extend::Marc.meeting_role_term_subfields)
  super
end