Class: Mindee::V2::FileOperation::SplitFiles
- Inherits:
-
Array
- Object
- Array
- Mindee::V2::FileOperation::SplitFiles
- Defined in:
- lib/mindee/v2/file_operation/split_files.rb
Overview
Collection of split files.
Instance Method Summary collapse
-
#save_all_to_disk(path, prefix: 'split') ⇒ Object
Save all extracted splits to disk.
Instance Method Details
#save_all_to_disk(path, prefix: 'split') ⇒ Object
Save all extracted splits to disk.
12 13 14 15 16 17 18 19 20 21 |
# File 'lib/mindee/v2/file_operation/split_files.rb', line 12 def save_all_to_disk(path, prefix: 'split') FileUtils.mkdir_p(path) each.with_index(1) do |split, idx| filename = "#{prefix}_#{format('%03d', idx)}.pdf" file_path = File.join(path.to_s, filename) split.write_to_file(file_path) end end |