Class: DumpCleaner::Cleanup::DataSource

Inherits:
Object
  • Object
show all
Defined in:
lib/dump_cleaner/cleanup/data_source.rb

Instance Method Summary collapse

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