Class: MasterDataTool::Import::Config
- Inherits:
-
Object
- Object
- MasterDataTool::Import::Config
- Defined in:
- lib/master_data_tool/import/config.rb
Constant Summary collapse
- DEFAULT_VALUES =
{ only_tables: [], except_tables: [], skip_no_change: true, ignore_foreign_key_when_delete: true, }
Instance Attribute Summary collapse
-
#except_tables ⇒ Object
Returns the value of attribute except_tables.
-
#ignore_foreign_key_when_delete ⇒ Object
Returns the value of attribute ignore_foreign_key_when_delete.
-
#only_tables ⇒ Object
Returns the value of attribute only_tables.
-
#skip_no_change ⇒ Object
Returns the value of attribute skip_no_change.
Class Method Summary collapse
Instance Method Summary collapse
- #configure {|_self| ... } ⇒ Object
-
#initialize(only_tables:, except_tables:, skip_no_change:, ignore_foreign_key_when_delete:) ⇒ Config
constructor
A new instance of Config.
- #skip_table?(table_name) ⇒ Boolean
Constructor Details
#initialize(only_tables:, except_tables:, skip_no_change:, ignore_foreign_key_when_delete:) ⇒ Config
Returns a new instance of Config.
13 14 15 16 17 18 |
# File 'lib/master_data_tool/import/config.rb', line 13 def initialize(only_tables:, except_tables:, skip_no_change:, ignore_foreign_key_when_delete:) @only_tables = only_tables @except_tables = except_tables @skip_no_change = skip_no_change @ignore_foreign_key_when_delete = ignore_foreign_key_when_delete end |
Instance Attribute Details
#except_tables ⇒ Object
Returns the value of attribute except_tables.
11 12 13 |
# File 'lib/master_data_tool/import/config.rb', line 11 def except_tables @except_tables end |
#ignore_foreign_key_when_delete ⇒ Object
Returns the value of attribute ignore_foreign_key_when_delete.
11 12 13 |
# File 'lib/master_data_tool/import/config.rb', line 11 def ignore_foreign_key_when_delete @ignore_foreign_key_when_delete end |
#only_tables ⇒ Object
Returns the value of attribute only_tables.
11 12 13 |
# File 'lib/master_data_tool/import/config.rb', line 11 def only_tables @only_tables end |
#skip_no_change ⇒ Object
Returns the value of attribute skip_no_change.
11 12 13 |
# File 'lib/master_data_tool/import/config.rb', line 11 def skip_no_change @skip_no_change end |
Class Method Details
.default_config ⇒ Object
29 30 31 |
# File 'lib/master_data_tool/import/config.rb', line 29 def default_config new(**DEFAULT_VALUES) end |
Instance Method Details
#configure {|_self| ... } ⇒ Object
24 25 26 |
# File 'lib/master_data_tool/import/config.rb', line 24 def configure yield self end |
#skip_table?(table_name) ⇒ Boolean
20 21 22 |
# File 'lib/master_data_tool/import/config.rb', line 20 def skip_table?(table_name) MasterDataTool.need_skip_table?(table_name, only_tables, except_tables) end |