Class: ModPorter::UploadedFile
- Inherits:
-
Object
- Object
- ModPorter::UploadedFile
- Defined in:
- lib/mod_porter.rb
Instance Attribute Summary collapse
-
#content_type ⇒ Object
Returns the value of attribute content_type.
-
#original_filename ⇒ Object
Returns the value of attribute original_filename.
-
#path ⇒ Object
Returns the value of attribute path.
Instance Method Summary collapse
-
#initialize(options) ⇒ UploadedFile
constructor
A new instance of UploadedFile.
- #size ⇒ Object
- #to_tempfile ⇒ Object
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() @path = [:path] @original_filename = [:filename] @content_type = [:content_type] end |
Instance Attribute Details
#content_type ⇒ Object
Returns the value of attribute content_type.
11 12 13 |
# File 'lib/mod_porter.rb', line 11 def content_type @content_type end |
#original_filename ⇒ Object
Returns the value of attribute original_filename.
11 12 13 |
# File 'lib/mod_porter.rb', line 11 def original_filename @original_filename end |
#path ⇒ Object
Returns the value of attribute path.
11 12 13 |
# File 'lib/mod_porter.rb', line 11 def path @path end |
Instance Method Details
#size ⇒ Object
23 24 25 |
# File 'lib/mod_porter.rb', line 23 def size File.size(self.path) end |
#to_tempfile ⇒ Object
19 20 21 |
# File 'lib/mod_porter.rb', line 19 def to_tempfile return File.new(self.path) end |