Class: Lockness::Decrypt

Inherits:
Object
  • Object
show all
Defined in:
lib/lockness/decrypt.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path:) ⇒ Decrypt



6
7
8
9
10
# File 'lib/lockness/decrypt.rb', line 6

def initialize(path:)
  @encrypted_file = EncryptedFile.new(path: path)

  file_not_found unless encrypted_file.exist?
end

Instance Attribute Details

#encrypted_fileObject (readonly)

Returns the value of attribute encrypted_file.



4
5
6
# File 'lib/lockness/decrypt.rb', line 4

def encrypted_file
  @encrypted_file
end

Instance Method Details

#decryptObject



12
13
14
# File 'lib/lockness/decrypt.rb', line 12

def decrypt
  Content.new(encrypted_file: encrypted_file).plain
end