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

ORIGINAL_FILE =
::Valkyrie::Vocab::PCDMUse.OriginalFile
EXTRACTED_TEXT =
::Valkyrie::Vocab::PCDMUse.ExtractedText
THUMBNAIL =
::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


20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'app/models/hyrax/file_metadata.rb', line 20

def uri_for(use:)
  case use
  when RDF::URI
    use
  when :original_file
    ORIGINAL_FILE
  when :extracted_file
    EXTRACTED_TEXT
  when :thumbnail_file
    THUMBNAIL
  else
    raise ArgumentError, "No PCDM use is recognized for #{use}"
  end
end