Class: MasterDataTool::Verify::Config

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

Constant Summary collapse

DEFAULT_VALUES =
{
  only_tables: [],
  except_tables: [],
  preload_belongs_to_associations: true,
  preload_associations: {},
  eager_load_associations: {}
}

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(only_tables:, except_tables:, preload_belongs_to_associations:, preload_associations:, eager_load_associations:) ⇒ Config

Returns a new instance of Config.



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

def initialize(only_tables:, except_tables:, preload_belongs_to_associations:, preload_associations:, eager_load_associations:)
  @only_tables = only_tables
  @except_tables = except_tables
  @preload_belongs_to_associations = preload_belongs_to_associations
  @preload_associations = preload_associations
  @eager_load_associations = eager_load_associations
end

Instance Attribute Details

#eager_load_associationsObject

Returns the value of attribute eager_load_associations.



12
13
14
# File 'lib/master_data_tool/verify/config.rb', line 12

def eager_load_associations
  @eager_load_associations
end

#except_tablesObject

Returns the value of attribute except_tables.



12
13
14
# File 'lib/master_data_tool/verify/config.rb', line 12

def except_tables
  @except_tables
end

#only_tablesObject

Returns the value of attribute only_tables.



12
13
14
# File 'lib/master_data_tool/verify/config.rb', line 12

def only_tables
  @only_tables
end

#preload_associationsObject

Returns the value of attribute preload_associations.



12
13
14
# File 'lib/master_data_tool/verify/config.rb', line 12

def preload_associations
  @preload_associations
end

#preload_belongs_to_associationsObject

Returns the value of attribute preload_belongs_to_associations.



12
13
14
# File 'lib/master_data_tool/verify/config.rb', line 12

def preload_belongs_to_associations
  @preload_belongs_to_associations
end

Class Method Details

.default_configObject



33
34
35
# File 'lib/master_data_tool/verify/config.rb', line 33

def default_config
  new(**DEFAULT_VALUES)
end

Instance Method Details

#configure {|_self| ... } ⇒ Object

Yields:

  • (_self)

Yield Parameters:



28
29
30
# File 'lib/master_data_tool/verify/config.rb', line 28

def configure
  yield self
end

#skip_table?(table_name) ⇒ Boolean

Returns:

  • (Boolean)


24
25
26
# File 'lib/master_data_tool/verify/config.rb', line 24

def skip_table?(table_name)
  MasterDataTool.need_skip_table?(table_name, only_tables, except_tables)
end