Module: NEU::MODS::Projection::Access

Includes:
Support, Selectors
Included in:
NEU::MODS::Projection
Defined in:
lib/neu/mods/projection/access.rb

Overview

The abstract and the access conditions, each joined into one value with its header and link as companion scalars. See docs/other-fields.md.

Constant Summary

Constants included from Support

Support::AUTHORITY_ATTRIBUTES

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Selectors

#abstract_nodes, #editable_creator_nodes, #keyword_subjects, #primary_title_info, #variant_title?

Class Method Details

.fold_type(str) ⇒ Object

Letters and digits only, lower-cased: records write @type in any casing.



51
52
53
# File 'lib/neu/mods/projection/access.rb', line 51

def self.fold_type(str)
  Canonicalize.canonical_ws(str).downcase.gsub(/[^a-z0-9]/, "")
end

Instance Method Details

#abstract ⇒ Object



17
18
19
# File 'lib/neu/mods/projection/access.rb', line 17

def abstract
  join_paragraphs(abstract_nodes)
end

#abstract_display_label ⇒ Object

Companion scalars, because #abstract joins every element into one string.



22
# File 'lib/neu/mods/projection/access.rb', line 22

def abstract_display_label = first_attr(abstract_nodes, "displayLabel")

#abstract_href ⇒ Object



23
# File 'lib/neu/mods/projection/access.rb', line 23

def abstract_href = first_href(abstract_nodes)

#access_condition ⇒ Object

Every accessCondition, whatever its type. The only field that carries an untyped or unrecognised one.



27
28
29
# File 'lib/neu/mods/projection/access.rb', line 27

def access_condition
  join_paragraphs(doc.xpath("/mods:mods/mods:accessCondition", NAMESPACE))
end

#access_condition_display_label ⇒ Object



35
# File 'lib/neu/mods/projection/access.rb', line 35

def access_condition_display_label = first_attr(access_condition_nodes, "displayLabel")

#access_condition_href ⇒ Object



36
# File 'lib/neu/mods/projection/access.rb', line 36

def access_condition_href = first_href(access_condition_nodes)

#restriction_on_access ⇒ Object



33
# File 'lib/neu/mods/projection/access.rb', line 33

def restriction_on_access = access_conditions_of_type("restriction on access")

#restriction_on_access_display_label ⇒ Object



44
45
46
# File 'lib/neu/mods/projection/access.rb', line 44

def restriction_on_access_display_label
  first_attr(access_condition_nodes("restriction on access"), "displayLabel")
end

#restriction_on_access_href ⇒ Object



48
# File 'lib/neu/mods/projection/access.rb', line 48

def restriction_on_access_href = first_href(access_condition_nodes("restriction on access"))

#use_and_reproduction ⇒ Object

Kept apart so a restriction is never shown to a reader as a licence.



32
# File 'lib/neu/mods/projection/access.rb', line 32

def use_and_reproduction = access_conditions_of_type("use and reproduction")

#use_and_reproduction_display_label ⇒ Object



38
39
40
# File 'lib/neu/mods/projection/access.rb', line 38

def use_and_reproduction_display_label
  first_attr(access_condition_nodes("use and reproduction"), "displayLabel")
end

#use_and_reproduction_href ⇒ Object



42
# File 'lib/neu/mods/projection/access.rb', line 42

def use_and_reproduction_href = first_href(access_condition_nodes("use and reproduction"))