Class: OnlyofficePdfParser::FileHelper
- Inherits:
-
Object
- Object
- OnlyofficePdfParser::FileHelper
- Defined in:
- lib/onlyoffice_pdf_parser/helpers/file_helper.rb
Overview
Class for working with files
Class Method Summary collapse
-
.file_path?(string) ⇒ True, False
If string is file path.
-
.generate_temp_name ⇒ String
Name for temp file.
Class Method Details
.file_path?(string) ⇒ True, False
Returns if string is file path.
16 17 18 19 20 |
# File 'lib/onlyoffice_pdf_parser/helpers/file_helper.rb', line 16 def file_path?(string) File.exist?(string) rescue ArgumentError false end |
.generate_temp_name ⇒ String
Returns name for temp file.
8 9 10 11 12 13 |
# File 'lib/onlyoffice_pdf_parser/helpers/file_helper.rb', line 8 def generate_temp_name file = Tempfile.new(%w[onlyoffice_bmp_parser .bmp]) path = file.path file.unlink path end |