class Hydra::Derivatives::RetrieveSourceFileService

Public Class Methods

call(object, options, &block) click to toggle source

Retrieves the source @param [ActiveFedora::Base] object the source file is attached to @param [Hash] options @option options [Symbol] :source a method that can be called on the object to retrieve the source file @yield [Tempfile] a temporary source file that has a lifetime of the block

# File lib/hydra/derivatives/services/retrieve_source_file_service.rb, line 8
def self.call(object, options, &block)
  source_name = options.fetch(:source)
  Hydra::Derivatives::TempfileService.create(object.send(source_name), &block)
end