Class: Hyrax::Ingest::Runner
- Inherits:
-
Object
- Object
- Hyrax::Ingest::Runner
- Includes:
- HasDepositor, HasIteration, HasLogger, HasReport, HasSIP, HasSharedSIP, Reporting, Interloper
- Defined in:
- lib/hyrax/ingest/runner.rb
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
Instance Method Summary collapse
-
#ingested_ids_by_type ⇒ Object
TODO: Does not yet return IDs of associated objects that were ingested as assocaited objects (i.e. objects that are nested under other objects in the ingest configuration).
-
#initialize(config_file_path:, sip_path: nil, shared_sip_path: nil, iteration: 0, depositor: nil) ⇒ Runner
constructor
A new instance of Runner.
- #run! ⇒ Object
Methods included from HasDepositor
Methods included from HasLogger
Methods included from HasReport
Methods included from HasIteration
Methods included from HasSharedSIP
Methods included from HasSIP
Methods included from Reporting
Constructor Details
#initialize(config_file_path:, sip_path: nil, shared_sip_path: nil, iteration: 0, depositor: nil) ⇒ Runner
Returns a new instance of Runner.
40 41 42 43 44 45 46 |
# File 'lib/hyrax/ingest/runner.rb', line 40 def initialize(config_file_path:, sip_path: nil, shared_sip_path: nil, iteration: 0, depositor: nil) self.sip = SIP.new(path: sip_path) if sip_path self.shared_sip = shared_sip_path != nil ? SIP.new(path: shared_sip_path) : nil self.iteration = iteration.to_i self.depositor = depositor @config = Hyrax::Ingest::Configuration.new(config_file_path: config_file_path) end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
24 25 26 |
# File 'lib/hyrax/ingest/runner.rb', line 24 def config @config end |
Instance Method Details
#ingested_ids_by_type ⇒ Object
TODO: Does not yet return IDs of associated objects that were ingested as assocaited objects (i.e. objects that are nested under other objects in the ingest configuration). It only returns IDs for objects that are ingested per the top-level of ingest configuration.
56 57 58 59 60 61 62 63 64 65 |
# File 'lib/hyrax/ingest/runner.rb', line 56 def ingested_ids_by_type {}.tap do |h| ingesters.each do |ingester| if ingester.respond_to? :af_model h[ingester.af_model.class] ||= [] h[ingester.af_model.class] << ingester.af_model.id end end end end |
#run! ⇒ Object
48 49 50 |
# File 'lib/hyrax/ingest/runner.rb', line 48 def run! ingesters.collect { |ingester| ingester.run! } end |