Class: KnapsackPro::Crypto::Encryptor

Inherits:
Object
  • Object
show all
Defined in:
lib/knapsack_pro/crypto/encryptor.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(test_files) ⇒ Encryptor

Returns a new instance of Encryptor.



14
15
16
# File 'lib/knapsack_pro/crypto/encryptor.rb', line 14

def initialize(test_files)
  @test_files = test_files
end

Class Method Details

.call(test_files) ⇒ Object



6
7
8
9
10
11
12
# File 'lib/knapsack_pro/crypto/encryptor.rb', line 6

def self.call(test_files)
  if KnapsackPro::Config::Env.test_files_encrypted?
    new(test_files).call
  else
    test_files
  end
end

Instance Method Details

#callObject



18
19
20
21
22
23
24
25
26
27
28
# File 'lib/knapsack_pro/crypto/encryptor.rb', line 18

def call
  encrypted_test_files = []

  test_files.each do |test_file|
    test_file_dup = test_file.dup
    test_file_dup['path'] = Digestor.salt_hexdigest(test_file['path'])
    encrypted_test_files << test_file_dup
  end

  encrypted_test_files
end