Class: Postmark::MittTempfile
- Inherits:
-
Tempfile
- Object
- Tempfile
- Postmark::MittTempfile
- Defined in:
- lib/postmark/mitt.rb
Instance Attribute Summary collapse
-
#content_type ⇒ Object
the content type of the “uploaded” file.
Instance Method Summary collapse
-
#initialize(basename, content_type, tmpdir = Dir::tmpdir) ⇒ MittTempfile
constructor
A new instance of MittTempfile.
- #original_filename ⇒ Object
Constructor Details
#initialize(basename, content_type, tmpdir = Dir::tmpdir) ⇒ MittTempfile
Returns a new instance of MittTempfile.
151 152 153 154 155 156 157 158 159 |
# File 'lib/postmark/mitt.rb', line 151 def initialize(basename, content_type, tmpdir=Dir::tmpdir) if Postmark.ruby19? super(basename, tmpdir, :encoding => 'ascii-8bit') else super(basename, tmpdir) end @basename = basename @content_type = content_type end |
Instance Attribute Details
#content_type ⇒ Object
the content type of the “uploaded” file
162 163 164 |
# File 'lib/postmark/mitt.rb', line 162 def content_type @content_type end |
Instance Method Details
#original_filename ⇒ Object
164 165 166 |
# File 'lib/postmark/mitt.rb', line 164 def original_filename @basename || file.basename(path) end |