Class: DumpCleaner::Cleaners::BaseCleaner
- Inherits:
-
Object
- Object
- DumpCleaner::Cleaners::BaseCleaner
show all
- Defined in:
- lib/dump_cleaner/cleaners/base_cleaner.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
#initialize(config:, options:) ⇒ BaseCleaner
Returns a new instance of BaseCleaner.
8
9
10
11
|
# File 'lib/dump_cleaner/cleaners/base_cleaner.rb', line 8
def initialize(config:, options:)
@config = config
@options = options
end
|
Instance Attribute Details
#config ⇒ Object
Returns the value of attribute config.
6
7
8
|
# File 'lib/dump_cleaner/cleaners/base_cleaner.rb', line 6
def config
@config
end
|
#options ⇒ Object
Returns the value of attribute options.
6
7
8
|
# File 'lib/dump_cleaner/cleaners/base_cleaner.rb', line 6
def options
@options
end
|
Instance Method Details
#clean ⇒ Object
17
18
19
|
# File 'lib/dump_cleaner/cleaners/base_cleaner.rb', line 17
def clean
raise NotImplementedError
end
|
#keep_same_record?(record, table_config:) ⇒ Boolean
25
26
27
28
29
|
# File 'lib/dump_cleaner/cleaners/base_cleaner.rb', line 25
def keep_same_record?(record, table_config:)
return false unless table_config.keep_same_record_conditions
Conditions.new(table_config.keep_same_record_conditions).evaluate_to_true?(record:)
end
|
#post_cleanup ⇒ Object
21
22
23
|
# File 'lib/dump_cleaner/cleaners/base_cleaner.rb', line 21
def post_cleanup
end
|
#pre_cleanup ⇒ Object
13
14
15
|
# File 'lib/dump_cleaner/cleaners/base_cleaner.rb', line 13
def pre_cleanup
end
|