Sha256: d81720d7c429b676e771fa42b066624d0f4da7d42edfc3092874f35c22494f7d
Contents?: true
Size: 1.09 KB
Versions: 25
Compression:
Stored size: 1.09 KB
Contents
# frozen_string_literal: true module Hyrax module Characterization ## # @api public class FileSetDescription include Hydra::Works::MimeTypes ## # @!attribute [rw] file_set # @return [Hyrax::FileSet] attr_accessor :file_set delegate :mime_type, to: :primary_file ## # @param [Hyrax::FileSet] file_set # @param [RDF::URI, Symbol] primary_file the type of file_set member to # use for characterization def initialize(file_set:, primary_file: Hyrax::FileMetadata::Use::ORIGINAL_FILE) self.file_set = file_set @primary_file_type_uri = Hyrax::FileMetadata::Use.uri_for(use: primary_file) end ## # @api public # @return [Hyrax::FileMetadata] the member file to use for characterization def primary_file queries.find_many_file_metadata_by_use(resource: file_set, use: @primary_file_type_uri).first || Hyrax::FileMetadata.new end private ## # @api private def queries Hyrax.custom_queries end end end end
Version data entries
25 entries across 25 versions & 1 rubygems