Class: DumpCleaner::Cleanup::DataSource
- Inherits:
-
Object
- Object
- DumpCleaner::Cleanup::DataSource
- Defined in:
- lib/dump_cleaner/cleanup/data_source.rb
Instance Method Summary collapse
- #data_for(type) ⇒ Object
-
#initialize(config:) ⇒ DataSource
constructor
A new instance of DataSource.
Constructor Details
#initialize(config:) ⇒ DataSource
Returns a new instance of DataSource.
6 7 8 9 10 |
# File 'lib/dump_cleaner/cleanup/data_source.rb', line 6 def initialize(config:) @config = config @workflow = Workflow.new(phase: :data_source) @data_cache = {} end |
Instance Method Details
#data_for(type) ⇒ Object
12 13 14 15 16 |
# File 'lib/dump_cleaner/cleanup/data_source.rb', line 12 def data_for(type) step_context = StepContext.new(type:, cleanup_data: nil) @data_cache[type] ||= @workflow.run(step_context, step_configs: @config.steps_for(type, :data_source)) .cleanup_data end |