Class: DataAnon::Core::FieldsMissingStrategy

Inherits:
Object
  • Object
show all
Includes:
Utils::Logging
Defined in:
lib/core/fields_missing_strategy.rb

Instance Method Summary collapse

Methods included from Utils::Logging

#logger, #logger=

Constructor Details

#initialize(table_name) ⇒ FieldsMissingStrategy

Returns a new instance of FieldsMissingStrategy.


7
8
9
10
# File 'lib/core/fields_missing_strategy.rb', line 7

def initialize table_name
  @table_name = table_name
  @fields_missing_strategy = []
end

Instance Method Details

#fields_missing_strategyObject


17
18
19
# File 'lib/core/fields_missing_strategy.rb', line 17

def fields_missing_strategy
  @fields_missing_strategy
end

#missing(field_name) ⇒ Object


12
13
14
15
# File 'lib/core/fields_missing_strategy.rb', line 12

def missing field_name
  return if @fields_missing_strategy.include? field_name
  @fields_missing_strategy << field_name
end

21
22
23
24
25
# File 'lib/core/fields_missing_strategy.rb', line 21

def print
  @fields_missing_strategy.each do |field_name|
    logger.info("#{@table_name}.#{field_name}")
  end
end