Class: Hyrax::Characterization::FileSetDescription
- Inherits:
-
Object
- Object
- Hyrax::Characterization::FileSetDescription
- Includes:
- Hydra::Works::MimeTypes
- Defined in:
- app/services/hyrax/characterization/file_set_description.rb
Instance Attribute Summary collapse
Instance Method Summary collapse
-
#initialize(file_set:, primary_file: Hyrax::FileMetadata::Use::ORIGINAL_FILE) ⇒ FileSetDescription
constructor
A new instance of FileSetDescription.
-
#primary_file ⇒ Hyrax::FileMetadata
The member file to use for characterization.
Constructor Details
#initialize(file_set:, primary_file: Hyrax::FileMetadata::Use::ORIGINAL_FILE) ⇒ FileSetDescription
Returns a new instance of FileSetDescription.
21 22 23 24 25 26 |
# File 'app/services/hyrax/characterization/file_set_description.rb', line 21 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 |
Instance Attribute Details
#file_set ⇒ Hyrax::FileSet
13 14 15 |
# File 'app/services/hyrax/characterization/file_set_description.rb', line 13 def file_set @file_set end |
Instance Method Details
#primary_file ⇒ Hyrax::FileMetadata
Returns the member file to use for characterization.
31 32 33 34 |
# File 'app/services/hyrax/characterization/file_set_description.rb', line 31 def primary_file queries.(resource: file_set, use: @primary_file_type_uri).first || Hyrax::FileMetadata.new end |