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.



12
13
14
# File 'lib/knapsack_pro/crypto/encryptor.rb', line 12

def initialize(test_files)
  @test_files = test_files
end

Class Method Details

.call(test_files) ⇒ Object



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

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



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

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