Sha256: 6b67d896effd57f3f9a312430f44cba574ed3609519bfd48b78d05e9415568bb

Contents?: true

Size: 564 Bytes

Versions: 14

Compression:

Stored size: 564 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

14 entries across 14 versions & 1 rubygems

Version Path
hydra-derivatives-3.7.0 lib/hydra/derivatives/services/retrieve_source_file_service.rb
hydra-derivatives-3.6.1 lib/hydra/derivatives/services/retrieve_source_file_service.rb
hydra-derivatives-3.6.0 lib/hydra/derivatives/services/retrieve_source_file_service.rb
hydra-derivatives-3.5.0 lib/hydra/derivatives/services/retrieve_source_file_service.rb
hydra-derivatives-3.4.2 lib/hydra/derivatives/services/retrieve_source_file_service.rb
hydra-derivatives-3.4.1 lib/hydra/derivatives/services/retrieve_source_file_service.rb
hydra-derivatives-3.4.0 lib/hydra/derivatives/services/retrieve_source_file_service.rb
hydra-derivatives-3.3.2 lib/hydra/derivatives/services/retrieve_source_file_service.rb
hydra-derivatives-3.3.1 lib/hydra/derivatives/services/retrieve_source_file_service.rb
hydra-derivatives-3.3.0 lib/hydra/derivatives/services/retrieve_source_file_service.rb
hydra-derivatives-3.2.2 lib/hydra/derivatives/services/retrieve_source_file_service.rb
hydra-derivatives-3.2.1 lib/hydra/derivatives/services/retrieve_source_file_service.rb
hydra-derivatives-3.2.0 lib/hydra/derivatives/services/retrieve_source_file_service.rb
hydra-derivatives-3.1.4 lib/hydra/derivatives/services/retrieve_source_file_service.rb