Module: Qa::Authorities::LocSubauthority
- Included in:
- Loc
- Defined in:
- lib/qa/authorities/loc_subauthority.rb
Instance Method Summary collapse
- #authorities ⇒ Object
- #datatypes ⇒ Object
- #get_url_for_authority(authority) ⇒ Object
-
#preservation ⇒ Object
rubocop:disable Metrics/MethodLength.
- #root_fetch_slug_for(authority) ⇒ String
-
#vocabularies ⇒ Object
rubocop:disable Metrics/MethodLength.
Instance Method Details
#authorities ⇒ Object
28 29 30 31 32 33 34 35 36 37 |
# File 'lib/qa/authorities/loc_subauthority.rb', line 28 def [ "subjects", "names", "classification", "childrensSubjects", "genreForms", "performanceMediums" ] end |
#datatypes ⇒ Object
57 58 59 |
# File 'lib/qa/authorities/loc_subauthority.rb', line 57 def datatypes ["edtf"] end |
#get_url_for_authority(authority) ⇒ Object
TODO:
Rename to reflect that this is a URI encoded url fragement used only for searching.
3 4 5 6 7 8 9 |
# File 'lib/qa/authorities/loc_subauthority.rb', line 3 def () if .include?() then elsif vocabularies.include?() then vocab_base_url elsif datatypes.include?() then datatype_base_url elsif preservation.include?() then vocab_preservation_base_url end end |
#preservation ⇒ Object
rubocop:disable Metrics/MethodLength
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 |
# File 'lib/qa/authorities/loc_subauthority.rb', line 61 def preservation # rubocop:disable Metrics/MethodLength [ "contentLocationType", "copyrightStatus", "cryptographicHashFunctions", "environmentCharacteristic", "environmentPurpose", "eventRelatedAgentRole", "eventRelatedObjectRole", "eventType", "formatRegistryRole", "hardwareType", "inhibitorTarget", "inhibitorType", "objectCategory", "preservationLevelRole", "relationshipSubType", "relationshipType", "rightsBasis", "rightsRelatedAgentRole", "signatureEncoding", "signatureMethod", "softwareType", "storageMedium" ] end |
#root_fetch_slug_for(authority) ⇒ String
Note:
The returned value is the root directory of the URL. The graphicMaterials sub-authority has a “type” of vocabulary. id.loc.gov/vocabulary/graphicMaterials/tgm008083.html In some cases, this is plural and in others this is singular.
Note:
there is a relationship between the returned value and the encoded URLs returned by #get_url_for_authority.
20 21 22 23 24 25 26 |
# File 'lib/qa/authorities/loc_subauthority.rb', line 20 def root_fetch_slug_for() () return "authorities" if .include?() return "vocabulary" if vocabularies.include?() return "datatype" if datatypes.include?() return "vocabulary/preservation" if preservation.include?() end |
#vocabularies ⇒ Object
rubocop:disable Metrics/MethodLength
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/qa/authorities/loc_subauthority.rb', line 39 def vocabularies # rubocop:disable Metrics/MethodLength [ "graphicMaterials", "organizations", "relators", "countries", "ethnographicTerms", "geographicAreas", "languages", "iso639-1", "iso639-2", "iso639-5", "preservation", "actionsGranted", "agentType" ] end |