Created
May 6, 2015 12:38
-
-
Save Agowan/3d3e5d7dd4c534f2a4ca to your computer and use it in GitHub Desktop.
Override StringIO content type
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# encoding: utf-8 | |
class StringFile < StringIO | |
def initialize(file_content, file_name, file_type) | |
super(file_content) | |
@file_name = file_name | |
@file_type = file_type | |
end | |
def content_type | |
@file_type | |
end | |
def original_filename | |
@file_name | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment