Class: PennMARC::Link

Inherits:
Helper
  • Object
show all
Defined in:
lib/pennmarc/helpers/link.rb

Overview

Do Link-y stuff

Constant Summary

Constants included from Util

Util::TRAILING_PUNCTUATIONS_PATTERNS

Class Method Summary collapse

Methods included from Util

#append_relator, #append_trailing, #datafield_and_linked_alternate, #field_defined?, #field_or_its_linked_alternate?, #join_and_squish, #join_subfields, #linked_alternate, #linked_alternate_not_6_or_8, #no_subfield_value_matches?, #prefixed_subject_and_alternate, #relator, #relator_join_separator, #relator_term_subfield, #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_punctuation, #trim_trailing, #trim_trailing!, #valid_subject_genre_source_code?

Class Method Details

Full text links from MARC 856 fields.

Parameters:

  • record (MARC::Record)

Returns:

  • (Array)

    array of hashes



16
17
18
19
# File 'lib/pennmarc/helpers/link.rb', line 16

def full_text_links(record)
  indicator2_options = %w[0 1]
  links_from_record(record, indicator2_options)
end

.offsite(record) ⇒ Object

TODO:

the legacy code here is a hot mess for a number of reasons, what do we need this field to do?

Note:

port the needed parts from get_offsite_display, don’t return HTML

Parameters:

  • record (MARC::Record)

Returns:

  • (Object)


11
# File 'lib/pennmarc/helpers/link.rb', line 11

def offsite(record); end

Web text links from MARC 856 fields.

Parameters:

  • record (MARC::Record)

Returns:

  • (Array)

    array of hashes



24
25
26
27
# File 'lib/pennmarc/helpers/link.rb', line 24

def web_links(record)
  indicator2_options = ['2', ' ', '']
  links_from_record(record, indicator2_options)
end