Class: EncryptedYaml::CLI::Encrypt
- Inherits:
-
Object
- Object
- EncryptedYaml::CLI::Encrypt
- Defined in:
- lib/encrypted_yaml/cli/encrypt.rb
Instance Method Summary collapse
- #encrypt ⇒ Object
-
#initialize(options) ⇒ Encrypt
constructor
A new instance of Encrypt.
Constructor Details
#initialize(options) ⇒ Encrypt
6 7 8 9 10 |
# File 'lib/encrypted_yaml/cli/encrypt.rb', line 6 def initialize() @keyfile = [:keyfile] @ivfile = [:ivfile] @filename = [:filename] end |
Instance Method Details
#encrypt ⇒ Object
12 13 14 15 16 17 |
# File 'lib/encrypted_yaml/cli/encrypt.rb', line 12 def encrypt data = File.read(@filename) cipher = get_cipher cipher.update(data) + cipher.final end |