class BPL::Derivatives::RetrieveSourceFileService
Public Class Methods
call(object, options, &block)
click to toggle source
Retrieves the source @param [ArbitraryObject] 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/bpl/derivatives/services/retrieve_source_file_service.rb, line 8 def self.call(object, options, &block) source_name = options.fetch(:source) BPL::Derivatives::TempfileService.create(object.send(source_name), &block) end