Class: Pludoni::Pdfutils::LocalFileWrapper

Inherits:
FileWrapper
  • Object
show all
Defined in:
lib/pludoni/pdfutils/local_file_wrapper.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from FileWrapper

#initialize, make

Constructor Details

This class inherits a constructor from Pludoni::Pdfutils::FileWrapper

Instance Attribute Details

#filenameObject



11
12
13
# File 'lib/pludoni/pdfutils/local_file_wrapper.rb', line 11

def filename
  @filename || @file.path.split("/").last
end

Instance Method Details

#content_typeObject



24
25
26
27
28
# File 'lib/pludoni/pdfutils/local_file_wrapper.rb', line 24

def content_type
  Marcel::MimeType.for(@file)
ensure
  @file.rewind
end

#filesizeObject



7
8
9
# File 'lib/pludoni/pdfutils/local_file_wrapper.rb', line 7

def filesize
  @file.size
end

#open(&block) ⇒ Object



20
21
22
# File 'lib/pludoni/pdfutils/local_file_wrapper.rb', line 20

def open(&block)
  @file.open(&block)
end

#to_tfObject



15
16
17
18
# File 'lib/pludoni/pdfutils/local_file_wrapper.rb', line 15

def to_tf
  @file.rewind
  @file
end