Class: PennMARC::Note
Overview
Extracts notes from 5xx fields (mostly).
Class Method Summary collapse
-
.access_restriction_show(record) ⇒ Array<String>
Retrieve access restricted notes for display from field 506.
-
.arrangement_show(record) ⇒ Array<String>
Retrieve arrangement values for display from field field 351.
-
.biography_show(record) ⇒ Array<String>
Retrieve biography notes for display from field 545 and its linked alternate.
-
.contents_show(record) ⇒ Array<String>
Retrieve contents notes for display from fields 505 and its linked alternate.
-
.credits_show(record) ⇒ Array<String>
Retrieve credits notes for display from field 508 and its linked alternate.
-
.finding_aid_show(record) ⇒ Array<String>
Retrieve finding aid notes for display from field 555 and its linked alternate.
- .local_notes_show(record) ⇒ Array<String>
- .notes_show(record) ⇒ Array<String>
-
.participant_show(record) ⇒ Array<String>
Retrieve participant notes for display from field 511 and its linked alternate.
- .provenance_show(record) ⇒ Array<String>
-
.summary_show(record) ⇒ Array<String>
Retrieve summary notes for display from field 520 and its linked alternate.
- .system_details_show(record) ⇒ Array<String>
Methods included from Util
#datafield_and_linked_alternate, #join_and_squish, #join_subfields, #linked_alternate, #linked_alternate_not_6_or_8, #prefixed_subject_and_alternate, #remove_paren_value_from_subfield_i, #subfield_defined?, #subfield_in?, #subfield_not_in?, #subfield_undefined?, #subfield_value?, #subfield_value_in?, #subfield_value_not_in?, #subfield_values, #subfield_values_for, #substring_after, #substring_before, #translate_relator, #trim_trailing, #valid_subject_genre_source_code?
Class Method Details
.access_restriction_show(record) ⇒ Array<String>
Retrieve access restricted notes for display from field 506.
83 84 85 86 87 |
# File 'lib/pennmarc/helpers/note.rb', line 83 def access_restriction_show(record) record.fields('506').filter_map do |field| join_subfields(field, &subfield_not_in?(%w[5 6])) end end |
.arrangement_show(record) ⇒ Array<String>
Retrieve arrangement values for display from field field 351.
132 133 134 |
# File 'lib/pennmarc/helpers/note.rb', line 132 def arrangement_show(record) datafield_and_linked_alternate(record, '351') end |
.biography_show(record) ⇒ Array<String>
Retrieve biography notes for display from field 545 and its linked alternate.
117 118 119 |
# File 'lib/pennmarc/helpers/note.rb', line 117 def biography_show(record) datafield_and_linked_alternate(record, '545') end |
.contents_show(record) ⇒ Array<String>
Retrieve contents notes for display from fields 505 and its linked alternate.
72 73 74 75 76 77 78 |
# File 'lib/pennmarc/helpers/note.rb', line 72 def contents_show(record) record.fields(%w[505 880]).filter_map { |field| next if field.tag == '880' && subfield_value_not_in?(field, '6', %w[505]) join_subfields(field, &subfield_not_in?(%w[6 8])).split('--') }.flatten end |
.credits_show(record) ⇒ Array<String>
Retrieve credits notes for display from field 508 and its linked alternate.
109 110 111 |
# File 'lib/pennmarc/helpers/note.rb', line 109 def credits_show(record) datafield_and_linked_alternate(record, '508') end |
.finding_aid_show(record) ⇒ Array<String>
Retrieve finding aid notes for display from field 555 and its linked alternate.
93 94 95 |
# File 'lib/pennmarc/helpers/note.rb', line 93 def finding_aid_show(record) datafield_and_linked_alternate(record, '555') end |
.local_notes_show(record) ⇒ Array<String>
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/pennmarc/helpers/note.rb', line 31 def local_notes_show(record) local_notes = record.fields('561').filter_map do |field| next unless subfield_value?(field, 'a', /^Athenaeum copy: /) join_subfields(field, &subfield_in?(%w[a])) end additional_fields = %w[562 563 585 590] local_notes + record.fields(additional_fields + ['880']).filter_map do |field| next if field.tag == '880' && subfield_value_not_in?(field, '6', additional_fields) join_subfields(field, &subfield_not_in?(%w[5 6 8])) end end |
.notes_show(record) ⇒ Array<String>
16 17 18 19 20 21 22 23 |
# File 'lib/pennmarc/helpers/note.rb', line 16 def notes_show(record) notes_fields = %w[500 502 504 515 518 525 533 550 580 586 588] record.fields(notes_fields + ['880']).filter_map do |field| next if field.tag == '880' && subfield_value_not_in?(field, '6', notes_fields) join_subfields(field, &subfield_not_in?(%w[5 6 8])) end end |
.participant_show(record) ⇒ Array<String>
Retrieve participant notes for display from field 511 and its linked alternate.
101 102 103 |
# File 'lib/pennmarc/helpers/note.rb', line 101 def participant_show(record) datafield_and_linked_alternate(record, '511') end |
.provenance_show(record) ⇒ Array<String>
53 54 55 56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/pennmarc/helpers/note.rb', line 53 def provenance_show(record) provenance_notes = record.fields(%w[561 880]).filter_map do |field| next unless field.indicator1.in?(['1', '', ' ']) next unless field.indicator2.in?([' ', '']) next if field.tag == '880' && subfield_value_not_in?(field, '6', %w[561]) next if subfield_value?(field, 'a', /^Athenaeum copy: /) join_subfields(field, &subfield_in?(%w[a])) end provenance_notes + prefixed_subject_and_alternate(record, 'PRO') end |
.summary_show(record) ⇒ Array<String>
Retrieve summary notes for display from field 520 and its linked alternate.
125 126 127 |
# File 'lib/pennmarc/helpers/note.rb', line 125 def summary_show(record) datafield_and_linked_alternate(record, '520') end |
.system_details_show(record) ⇒ Array<String>
142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 |
# File 'lib/pennmarc/helpers/note.rb', line 142 def system_details_show(record) system_details_notes = record.fields(%w[538 880]).filter_map do |field| next if field.tag == '880' && subfield_value_not_in?(field, '6', ['538']) sub3_and_other_subs(field, &subfield_in?(%w[a i u])) end system_details_notes += record.fields(%w[344 880]).filter_map do |field| next if field.tag == '880' && subfield_value_not_in?(field, '6', ['344']) sub3_and_other_subs(field, &subfield_in?(%w[a b c d e f g h])) end system_details_notes += record.fields(%w[345 346 880]).filter_map do |field| next if field.tag == '880' && subfield_value_not_in?(field, '6', %w[345 346]) sub3_and_other_subs(field, &subfield_in?(%w[a b])) end system_details_notes += record.fields(%w[347 880]).filter_map do |field| next if field.tag == '880' && subfield_value_not_in?(field, '6', ['347']) sub3_and_other_subs(field, &subfield_in?(%w[a b c d e f])) end system_details_notes end |