class Hyrax::Ingest::Ingester::WorkIngester
Attributes
file_sets_config[R]
Public Class Methods
new(config={})
click to toggle source
Calls superclass method
Hyrax::Ingest::Ingester::ActiveFedoraBaseIngester::new
# File lib/hyrax/ingest/ingester/work_ingester.rb, line 10 def initialize(config={}) # TODO: Throw a useful custom error when :type option is missing. config[:af_model_class_name] ||= config.delete(:type) @file_sets_config = config.delete(:FileSets) || [] super(config) end
Public Instance Methods
run!()
click to toggle source
# File lib/hyrax/ingest/ingester/work_ingester.rb, line 17 def run! assign_properties! assign_related_file_set_properties! apply_depositor_metadata! save_model! assign_file_sets_to_work! # return the new instance of the ActiveFedora model af_model end
Private Instance Methods
apply_depositor_metadata!()
click to toggle source
# File lib/hyrax/ingest/ingester/work_ingester.rb, line 29 def apply_depositor_metadata! af_model.apply_depositor_metadata(depositor) if depositor end
assign_file_sets_to_work!()
click to toggle source
# File lib/hyrax/ingest/ingester/work_ingester.rb, line 37 def assign_file_sets_to_work! file_set_ingesters.each do |file_set_ingester| af_model.members += [file_set_ingester.af_model] end end
file_set_ingesters()
click to toggle source
# File lib/hyrax/ingest/ingester/work_ingester.rb, line 43 def file_set_ingesters @file_set_ingesters ||= @file_sets_config.map do |file_set_config| Hyrax::Ingest::Ingester::FileSetIngester.new(file_set_config).tap do |file_set_ingester| file_set_ingester.sip = sip if file_set_ingester.respond_to?(:sip=) file_set_ingester.shared_sip = shared_sip if file_set_ingester.respond_to?(:shared_sip=) file_set_ingester.iteration = iteration if file_set_ingester.respond_to?(:iteration=) end end end