Sha256: dfb2703a15f94f5aac68f6fe79ef2c9b519859fbaa6434f8b3e3e54aa4c169da

Contents?: true

Size: 565 Bytes

Versions: 7

Compression:

Stored size: 565 Bytes

Contents

module Hydra::Derivatives
  class RetrieveSourceFileService

    # 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
    def self.call(object, options, &block)
      source_name = options.fetch(:source)
      Hydra::Derivatives::TempfileService.create(object.send(source_name), &block)
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
hydra-derivatives-3.1.3 lib/hydra/derivatives/services/retrieve_source_file_service.rb
hydra-derivatives-3.1.2 lib/hydra/derivatives/services/retrieve_source_file_service.rb
hydra-derivatives-3.1.1 lib/hydra/derivatives/services/retrieve_source_file_service.rb
hydra-derivatives-3.1.0 lib/hydra/derivatives/services/retrieve_source_file_service.rb
hydra-derivatives-3.0.2 lib/hydra/derivatives/services/retrieve_source_file_service.rb
hydra-derivatives-3.0.1 lib/hydra/derivatives/services/retrieve_source_file_service.rb
hydra-derivatives-3.0.0 lib/hydra/derivatives/services/retrieve_source_file_service.rb