Class: Hydra::Derivatives::RetrieveSourceFileService

Inherits:
Object
  • Object
show all
Defined in:
lib/hydra/derivatives/services/retrieve_source_file_service.rb

Class Method Summary collapse

Class Method Details

.call(object, options) {|Tempfile| ... } ⇒ Object

Retrieves the source

Parameters:

  • object (ActiveFedora::Base)

    the source file is attached to

  • options (Hash)

Options Hash (options):

  • :source (Symbol)

    a method that can be called on the object to retrieve the source file

Yields:

  • (Tempfile)

    a temporary source file that has a lifetime of the block


8
9
10
11
# 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