Class: Strike::Obfuscator

Inherits:
Object
  • Object
show all
Defined in:
lib/strike/obfuscator.rb

Instance Method Summary collapse

Constructor Details

#initialize(config = {}) ⇒ Obfuscator

Returns a new instance of Obfuscator.



7
8
9
# File 'lib/strike/obfuscator.rb', line 7

def initialize(config = {})
  @adapter_source = config[:adapter_source]
end

Instance Method Details

#call(tables, input, output) ⇒ nil

Obfuscates the data from input to output with the given information.

Parameters:

  • tables (Hash)

    the tables definitions

  • input (IO)

    the input source to read from.

  • output (IO)

    the output source to write to.

Returns:

  • (nil)


18
19
20
21
22
23
# File 'lib/strike/obfuscator.rb', line 18

def call(tables, input, output)
  adapter = adapter_source.call(tables)
  adapter.globally_kept_columns = %w(id created_at updated_at)

  adapter.obfuscate(input, output)
end