Module: Hyrax::FileMetadata::Use

Defined in:
app/models/hyrax/file_metadata.rb

Overview

Constants for PCDM Use URIs; use these constants in place of hard-coded URIs in the ‘::Valkyrie::Vocab::PCDMUse` vocabulary.

Constant Summary collapse

EXTRACTED_TEXT =
::Valkyrie::Vocab::PCDMUse.ExtractedText
INTERMEDIATE_FILE =
::Valkyrie::Vocab::PCDMUse.IntermediateFile
ORIGINAL_FILE =
::Valkyrie::Vocab::PCDMUse.OriginalFile
PRESERVATION_FILE =
::Valkyrie::Vocab::PCDMUse.PreservationFile
SERVICE_FILE =
::Valkyrie::Vocab::PCDMUse.ServiceFile
THUMBNAIL_IMAGE =
::Valkyrie::Vocab::PCDMUse.ThumbnailImage
TRANSCRIPT =
::Valkyrie::Vocab::PCDMUse.Transcript
THUMBNAIL =

for compatibility with earlier versions of Hyrax; prefer THUMBNAIL_IMAGE

::Valkyrie::Vocab::PCDMUse.ThumbnailImage

Class Method Summary collapse

Class Method Details

.uri_for(use:) ⇒ RDF::URI

Parameters:

  • use (RDF::URI, Symbol)

Returns:

  • (RDF::URI)

Raises:

  • (ArgumentError)

    if no use is known for the argument



50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# File 'app/models/hyrax/file_metadata.rb', line 50

def uri_for(use:) # rubocop:disable Metrics/MethodLength
  case use
  when RDF::URI
    use
  when :extracted_file
    EXTRACTED_TEXT
  when :intermediate_file
    INTERMEDIATE_FILE
  when :original_file
    ORIGINAL_FILE
  when :preservation_file
    PRESERVATION_FILE
  when :service_file
    SERVICE_FILE
  when :thumbnail_file
    THUMBNAIL_IMAGE
  when :transcript_file
    TRANSCRIPT
  else
    raise ArgumentError, "No PCDM use is recognized for #{use}"
  end
end