Module: MultiXml::FileLike
- Defined in:
- lib/multi_xml/file_like.rb
Overview
Mixin that provides file-like metadata to StringIO objects
Used when parsing base64-encoded file content from XML. Adds original_filename and content_type attributes to StringIO.
Constant Summary collapse
- DEFAULT_FILENAME =
Default filename when none is specified
"untitled".freeze
- DEFAULT_CONTENT_TYPE =
Default content type when none is specified
"application/octet-stream".freeze
Instance Attribute Summary collapse
-
#content_type ⇒ String
Get the content type.
-
#original_filename ⇒ String
Get the original filename.
Instance Attribute Details
#content_type ⇒ String
Get the content type
58 59 60 |
# File 'lib/multi_xml/file_like.rb', line 58 def content_type @content_type || DEFAULT_CONTENT_TYPE end |
#original_filename ⇒ String
Get the original filename
48 49 50 |
# File 'lib/multi_xml/file_like.rb', line 48 def original_filename @original_filename || DEFAULT_FILENAME end |