Class: CurationConcerns::DerivativePath

Inherits:
Object
  • Object
show all
Defined in:
app/services/curation_concerns/derivative_path.rb

Class Method Summary collapse

Class Method Details

.derivative_path_for_reference(object, destination_name) ⇒ Object

Path on file system where derivative file is stored



5
6
7
8
# File 'app/services/curation_concerns/derivative_path.rb', line 5

def derivative_path_for_reference(object, destination_name)
  destination_name = destination_name.gsub(/^original_file_/, '')
  derivative_path(object, extension_for(destination_name), destination_name)
end

.derivatives_for_reference(object) ⇒ Array<String>

Returns Array of paths to derivatives for this object.

Returns:

  • (Array<String>)

    Array of paths to derivatives for this object.



11
12
13
14
15
# File 'app/services/curation_concerns/derivative_path.rb', line 11

def derivatives_for_reference(object)
  Dir.glob(root_path(object).join("*")).select do |path|
    path.start_with?(path_prefix(object).to_s)
  end
end