Class: ModPorter::UploadedFile

Inherits:
Object
  • Object
show all
Defined in:
lib/mod_porter.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ UploadedFile

Returns a new instance of UploadedFile.



13
14
15
16
17
# File 'lib/mod_porter.rb', line 13

def initialize(options)
  @path = options[:path]
  @original_filename = options[:filename]
  @content_type = options[:content_type]
end

Instance Attribute Details

#content_typeObject

Returns the value of attribute content_type.



11
12
13
# File 'lib/mod_porter.rb', line 11

def content_type
  @content_type
end

#original_filenameObject

Returns the value of attribute original_filename.



11
12
13
# File 'lib/mod_porter.rb', line 11

def original_filename
  @original_filename
end

#pathObject

Returns the value of attribute path.



11
12
13
# File 'lib/mod_porter.rb', line 11

def path
  @path
end

Instance Method Details

#sizeObject



23
24
25
# File 'lib/mod_porter.rb', line 23

def size
  File.size(self.path)
end

#to_tempfileObject



19
20
21
# File 'lib/mod_porter.rb', line 19

def to_tempfile
  return File.new(self.path)
end