Class: KnapsackPro::Crypto::BranchEncryptor
- Inherits:
-
Object
- Object
- KnapsackPro::Crypto::BranchEncryptor
- Defined in:
- lib/knapsack_pro/crypto/branch_encryptor.rb
Constant Summary collapse
- NON_ENCRYPTABLE_BRANCHES =
%w(develop development dev master staging)
Class Method Summary collapse
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(branch) ⇒ BranchEncryptor
constructor
A new instance of BranchEncryptor.
Constructor Details
#initialize(branch) ⇒ BranchEncryptor
Returns a new instance of BranchEncryptor.
14 15 16 |
# File 'lib/knapsack_pro/crypto/branch_encryptor.rb', line 14 def initialize(branch) @branch = branch end |
Class Method Details
.call(branch) ⇒ Object
6 7 8 9 10 11 12 |
# File 'lib/knapsack_pro/crypto/branch_encryptor.rb', line 6 def self.call(branch) if KnapsackPro::Config::Env.branch_encrypted? new(branch).call else branch end end |
Instance Method Details
#call ⇒ Object
18 19 20 21 22 23 24 |
# File 'lib/knapsack_pro/crypto/branch_encryptor.rb', line 18 def call if NON_ENCRYPTABLE_BRANCHES.include?(branch) branch else Digestor.salt_hexdigest(branch)[0..6] end end |