Class: Shellject::Tasks::Save
- Inherits:
-
Object
- Object
- Shellject::Tasks::Save
- Includes:
- CryptoTask
- Defined in:
- lib/shellject/tasks/save.rb
Overview
Encrypts and saves a file as a shelljection.
Instance Attribute Summary collapse
-
#input_path ⇒ Object
readonly
Returns the value of attribute input_path.
-
#save_directory ⇒ Object
readonly
Returns the value of attribute save_directory.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(save_directory, input_path, name = nil) ⇒ Save
constructor
A new instance of Save.
Methods included from CryptoTask
Constructor Details
#initialize(save_directory, input_path, name = nil) ⇒ Save
Returns a new instance of Save.
8 9 10 11 12 |
# File 'lib/shellject/tasks/save.rb', line 8 def initialize(save_directory, input_path, name = nil) @save_directory = save_directory @input_path = input_path @name = name end |
Instance Attribute Details
#input_path ⇒ Object (readonly)
Returns the value of attribute input_path.
6 7 8 |
# File 'lib/shellject/tasks/save.rb', line 6 def input_path @input_path end |
#save_directory ⇒ Object (readonly)
Returns the value of attribute save_directory.
6 7 8 |
# File 'lib/shellject/tasks/save.rb', line 6 def save_directory @save_directory end |
Instance Method Details
#call ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/shellject/tasks/save.rb', line 14 def call ensure_readable ensure_writable with_files do |from, to| crypto.encrypt from, output: to end end |