Class: Lockness::Show

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeShow

Returns a new instance of Show.



6
7
8
# File 'lib/lockness/show.rb', line 6

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

Instance Attribute Details

#encrypted_fileObject (readonly)

Returns the value of attribute encrypted_file.



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

def encrypted_file
  @encrypted_file
end

Instance Method Details

#showObject



10
11
12
13
14
15
16
17
18
# File 'lib/lockness/show.rb', line 10

def show
  if encrypted_file.exist?
    puts Content.new(encrypted_file: encrypted_file).plain
  else
    puts "No file at #{encrypted_file.encrypted_path}"

    exit 1
  end
end