Class: Pdfh::Services::DocumentManager
- Inherits:
-
Object
- Object
- Pdfh::Services::DocumentManager
- Defined in:
- lib/pdfh/services/document_manager.rb
Overview
Manages the documents, rename, move, etc.
Constant Summary collapse
- PDF_UNLOCKED_MAGIC_SUFFIX =
"_unlocked"
Instance Method Summary collapse
Constructor Details
#initialize(document, base_path:, dry_run:) ⇒ DocumentManager
13 14 15 16 17 |
# File 'lib/pdfh/services/document_manager.rb', line 13 def initialize(document, base_path:, dry_run:) @document = document @base_path = base_path @dry_run = dry_run end |
Instance Method Details
#call ⇒ void
This method returns an undefined value.
20 21 22 23 24 25 26 27 28 29 |
# File 'lib/pdfh/services/document_manager.rb', line 20 def call destination_dir = File.join(@base_path, @document.store_path) destination_file = File.join(destination_dir, @document.new_name) print_info(destination_dir) if Pdfh.logger.verbose? create_destination_dir(destination_dir) copy_pdf(destination_file) move_companion_files(destination_dir) backup_original end |