Class: Cheftacular::Encryptor
- Inherits:
-
Object
- Object
- Cheftacular::Encryptor
- Defined in:
- lib/cheftacular/encryptor.rb
Constant Summary collapse
- ALGORITHM =
'aes-256-cbc'
Instance Method Summary collapse
-
#initialize(data_bag_secret) ⇒ Encryptor
constructor
A new instance of Encryptor.
- #return_encrypted_hash(hash) ⇒ Object
Constructor Details
#initialize(data_bag_secret) ⇒ Encryptor
Returns a new instance of Encryptor.
6 7 8 |
# File 'lib/cheftacular/encryptor.rb', line 6 def initialize data_bag_secret @data_bag_secret = data_bag_secret end |
Instance Method Details
#return_encrypted_hash(hash) ⇒ Object
10 11 12 13 14 15 16 |
# File 'lib/cheftacular/encryptor.rb', line 10 def return_encrypted_hash hash hash.each_pair do |key, value| hash[key] = encrypt_data_for_databag(value) unless (key =~ /id/) == 0 end hash end |