Sha256: 98c551551ab2053199675df278c1d802dfd6b8e2520166ddc4f1ab85bf3dd7db

Contents?: true

Size: 1.93 KB

Versions: 35

Compression:

Stored size: 1.93 KB

Contents

module Qa::Authorities::LocSubauthority
  def get_url_for_authority(authority)
    if authorities.include?(authority) then authority_base_url
    elsif vocabularies.include?(authority) then vocab_base_url
    elsif datatypes.include?(authority)    then datatype_base_url
    elsif preservation.include?(authority) then vocab_preservation_base_url
    end
  end

  def authorities
    [
      "subjects",
      "names",
      "classification",
      "childrensSubjects",
      "genreForms",
      "performanceMediums"
    ]
  end

  def vocabularies # rubocop:disable Metrics/MethodLength
    [
      "graphicMaterials",
      "organizations",
      "relators",
      "countries",
      "ethnographicTerms",
      "geographicAreas",
      "languages",
      "iso639-1",
      "iso639-2",
      "iso639-5",
      "preservation",
      "actionsGranted",
      "agentType"
    ]
  end

  def datatypes
    ["edtf"]
  end

  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

  private

    def vocab_base_url
      "cs%3Ahttp%3A%2F%2Fid.loc.gov%2Fvocabulary%2F"
    end

    def authority_base_url
      "cs%3Ahttp%3A%2F%2Fid.loc.gov%2Fauthorities%2F"
    end

    def datatype_base_url
      "cs%3Ahttp%3A%2F%2Fid.loc.gov%2Fdatatypes%2F"
    end

    def vocab_preservation_base_url
      "cs%3Ahttp%3A%2F%2Fid.loc.gov%2Fvocabulary%2Fpreservation%2F"
    end
end

Version data entries

35 entries across 35 versions & 1 rubygems

Version Path
qa-5.13.0 lib/qa/authorities/loc_subauthority.rb
qa-5.12.0 lib/qa/authorities/loc_subauthority.rb
qa-5.11.0 lib/qa/authorities/loc_subauthority.rb
qa-5.10.0 lib/qa/authorities/loc_subauthority.rb
qa-5.9.0 lib/qa/authorities/loc_subauthority.rb
qa-5.8.1 lib/qa/authorities/loc_subauthority.rb
qa-5.8.0 lib/qa/authorities/loc_subauthority.rb
qa-5.7.0 lib/qa/authorities/loc_subauthority.rb
qa-5.6.0 lib/qa/authorities/loc_subauthority.rb
qa-5.5.2 lib/qa/authorities/loc_subauthority.rb
qa-4.3.0 lib/qa/authorities/loc_subauthority.rb
qa-3.1.0 lib/qa/authorities/loc_subauthority.rb
qa-2.3.0 lib/qa/authorities/loc_subauthority.rb
qa-5.5.1 lib/qa/authorities/loc_subauthority.rb
qa-5.4.0 lib/qa/authorities/loc_subauthority.rb
qa-5.3.1 lib/qa/authorities/loc_subauthority.rb
qa-5.3.0 lib/qa/authorities/loc_subauthority.rb
qa-5.2.0 lib/qa/authorities/loc_subauthority.rb
qa-5.1.0 lib/qa/authorities/loc_subauthority.rb
qa-5.0.0 lib/qa/authorities/loc_subauthority.rb