Class: MasterDataTool::Dump::Config

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

Constant Summary collapse

DEFAULT_IGNORE_TABLES =
%w[ar_internal_metadata schema_migrations master_data_statuses]
DEFAULT_IGNORE_COLUMNS =
%w[created_at updated_at]
DEFAULT_VALUES =
{
  ignore_empty_table: true,
  ignore_tables: [],
  ignore_column_names: [],
  only_tables: [],
}

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(ignore_empty_table:, ignore_tables:, ignore_column_names:, only_tables:) ⇒ Config

Returns a new instance of Config.



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

def initialize(ignore_empty_table:, ignore_tables:, ignore_column_names:, only_tables:)
  @ignore_empty_table = ignore_empty_table
  @ignore_tables = DEFAULT_IGNORE_TABLES + ignore_tables
  @ignore_column_names = DEFAULT_IGNORE_COLUMNS + ignore_column_names
  @only_tables = only_tables
end

Instance Attribute Details

#ignore_column_namesObject

Returns the value of attribute ignore_column_names.



14
15
16
# File 'lib/master_data_tool/dump/config.rb', line 14

def ignore_column_names
  @ignore_column_names
end

#ignore_empty_tableObject

Returns the value of attribute ignore_empty_table.



14
15
16
# File 'lib/master_data_tool/dump/config.rb', line 14

def ignore_empty_table
  @ignore_empty_table
end

#ignore_tablesObject

Returns the value of attribute ignore_tables.



14
15
16
# File 'lib/master_data_tool/dump/config.rb', line 14

def ignore_tables
  @ignore_tables
end

#only_tablesObject

Returns the value of attribute only_tables.



14
15
16
# File 'lib/master_data_tool/dump/config.rb', line 14

def only_tables
  @only_tables
end

Class Method Details

.default_configObject



36
37
38
# File 'lib/master_data_tool/dump/config.rb', line 36

def default_config
  new(**DEFAULT_VALUES)
end

Instance Method Details

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

Yields:

  • (_self)

Yield Parameters:



23
24
25
# File 'lib/master_data_tool/dump/config.rb', line 23

def configure
  yield self
end