Class: Hydra::Derivatives::Runner
- Inherits:
-
Object
- Object
- Hydra::Derivatives::Runner
- Defined in:
- lib/hydra/derivatives/runners/runner.rb
Direct Known Subclasses
ActiveEncodeDerivatives, AudioDerivatives, DocumentDerivatives, ImageDerivatives, Jpeg2kImageDerivatives, VideoDerivatives
Class Attribute Summary collapse
-
.output_file_service ⇒ Object
Use the output service configured for this class or default to the global setting.
-
.source_file_service ⇒ Object
Use the source service configured for this class or default to the global setting.
Class Method Summary collapse
- .create(object_or_filename, options) ⇒ Object
- .processor_class ⇒ Object
- .source_file(object_or_filename, options, &block) ⇒ Object
-
.transform_directives(options) ⇒ Object
Override this method if you need to add any defaults.
Class Attribute Details
.output_file_service ⇒ Object
Use the output service configured for this class or default to the global setting
10 11 12 |
# File 'lib/hydra/derivatives/runners/runner.rb', line 10 def self.output_file_service @output_file_service || Hydra::Derivatives.output_file_service end |
.source_file_service ⇒ Object
Use the source service configured for this class or default to the global setting
19 20 21 |
# File 'lib/hydra/derivatives/runners/runner.rb', line 19 def self.source_file_service @source_file_service || Hydra::Derivatives.source_file_service end |
Class Method Details
.create(object_or_filename, options) ⇒ Object
26 27 28 29 30 31 32 33 34 |
# File 'lib/hydra/derivatives/runners/runner.rb', line 26 def self.create(object_or_filename, ) source_file(object_or_filename, ) do |f| transform_directives(.delete(:outputs)).each do |instructions| processor_class.new(f.path, instructions.merge(source_file_service: source_file_service), output_file_service: output_file_service).process end end end |
.processor_class ⇒ Object
45 46 47 |
# File 'lib/hydra/derivatives/runners/runner.rb', line 45 def self.processor_class raise "Overide the processor_class method in a sub class" end |
.source_file(object_or_filename, options, &block) ⇒ Object
41 42 43 |
# File 'lib/hydra/derivatives/runners/runner.rb', line 41 def self.source_file(object_or_filename, , &block) source_file_service.call(object_or_filename, , &block) end |
.transform_directives(options) ⇒ Object
Override this method if you need to add any defaults
37 38 39 |
# File 'lib/hydra/derivatives/runners/runner.rb', line 37 def self.transform_directives() end |