Class: Underlock::Base

Inherits:
Object
  • Object
show all
Extended by:
Dry::Configurable
Defined in:
lib/underlock/base.rb

Class Method Summary collapse

Class Method Details

.decrypt(encrypted_entity) ⇒ Object



19
20
21
# File 'lib/underlock/base.rb', line 19

def decrypt(encrypted_entity)
  encrypted_entity.decrypt
end

.encrypt(unencrypted_value) ⇒ Object



12
13
14
15
16
17
# File 'lib/underlock/base.rb', line 12

def encrypt(unencrypted_value)
  case unencrypted_value
    when File, Pathname   then FileEncryptor.new.encrypt(unencrypted_value)
    when String           then Encryptor.new.encrypt(unencrypted_value)
  end
end