Class: MasterDataTool::Verify::Executor

Inherits:
Object
  • Object
show all
Defined in:
lib/master_data_tool/verify/executor.rb

Instance Method Summary collapse

Constructor Details

#initialize(spec_config:, verify_config: nil, silent: false, override_identifier: nil, report_printer: nil) ⇒ Executor

Returns a new instance of Executor.



6
7
8
9
10
11
12
13
# File 'lib/master_data_tool/verify/executor.rb', line 6

def initialize(spec_config:, verify_config: nil, silent: false, override_identifier: nil, report_printer: nil)
  @spec_config = spec_config
  @verify_config = verify_config || MasterDataTool::Verify::Config.default_config
  @silent = silent
  @override_identifier = override_identifier
  @report_printer = report_printer || MasterDataTool::Report::DefaultPrinter.new(spec_config: spec_config)
  @report_printer.silent = silent
end

Instance Method Details

#executeObject



15
16
17
18
19
20
21
22
23
# File 'lib/master_data_tool/verify/executor.rb', line 15

def execute
  master_data_collection = build_master_data_collection
  master_data_collection.each do |master_data|
    next if verify_config.skip_table?(master_data.table_name)

    report = master_data.verify!(verify_config: verify_config, ignore_fail: false)
    report.print(printer: report_printer)
  end
end