Class: Pludoni::Pdfutils::ActiveStorageWrapper
Instance Method Summary
collapse
Methods inherited from FileWrapper
#initialize, make
Instance Method Details
#content_type ⇒ Object
22
23
24
|
# File 'lib/pludoni/pdfutils/active_storage_wrapper.rb', line 22
def content_type
@file.content_type
end
|
#filename ⇒ Object
14
15
16
|
# File 'lib/pludoni/pdfutils/active_storage_wrapper.rb', line 14
def filename
@file.filename.to_s
end
|
#filesize ⇒ Object
4
5
6
|
# File 'lib/pludoni/pdfutils/active_storage_wrapper.rb', line 4
def filesize
@file.byte_size
end
|
#open(&block) ⇒ Object
18
19
20
|
# File 'lib/pludoni/pdfutils/active_storage_wrapper.rb', line 18
def open(&block)
@file.open(&block)
end
|
#to_tf ⇒ Object
8
9
10
11
12
|
# File 'lib/pludoni/pdfutils/active_storage_wrapper.rb', line 8
def to_tf
file = Tempfile.new([@file.filename.base, @file.filename.extension_with_delimiter])
ActiveStorage::Downloader.new(@file.service).send(:download, @file.key, file)
file
end
|