Class: SMail::MIME::ContentDisposition
- Inherits:
-
ContentField
- Object
- ContentField
- SMail::MIME::ContentDisposition
- Defined in:
- lib/smail/mime/content_fields.rb
Overview
An object representing a Content-Disposition header as specified in RFC2183.
Instance Attribute Summary
Attributes inherited from ContentField
Instance Method Summary collapse
-
#attachment? ⇒ Boolean
Is this an attachment part?.
-
#creation_date ⇒ Object
Returns the creation date if available or nil.
-
#filename ⇒ Object
Returns the filename if specified.
-
#inline? ⇒ Boolean
Is this an inline part??.
-
#modification_date ⇒ Object
Returns the modification date if available or nil.
-
#read_date ⇒ Object
Returns the read date if available or nil.
-
#size ⇒ Object
Returns the size if available or nil.
-
#to_s ⇒ Object
Returns the Content-Disposition as a string suitable for inclusion in an email header.
Methods inherited from ContentField
Constructor Details
This class inherits a constructor from SMail::MIME::ContentField
Instance Method Details
#attachment? ⇒ Boolean
Is this an attachment part?
73 74 75 |
# File 'lib/smail/mime/content_fields.rb', line 73 def type == "attachment" end |
#creation_date ⇒ Object
Returns the creation date if available or nil.
83 84 85 |
# File 'lib/smail/mime/content_fields.rb', line 83 def creation_date self.params['creation-date'] # FIXME: parse as a date? end |
#filename ⇒ Object
Returns the filename if specified
78 79 80 |
# File 'lib/smail/mime/content_fields.rb', line 78 def filename self.params['filename'] end |
#inline? ⇒ Boolean
Is this an inline part??
68 69 70 |
# File 'lib/smail/mime/content_fields.rb', line 68 def inline? type == 'inline' end |
#modification_date ⇒ Object
Returns the modification date if available or nil.
88 89 90 |
# File 'lib/smail/mime/content_fields.rb', line 88 def modification_date self.params['modification-date'] # FIXME: parse as a date? end |
#read_date ⇒ Object
Returns the read date if available or nil.
93 94 95 |
# File 'lib/smail/mime/content_fields.rb', line 93 def read_date self.params['read-date'] # FIXME: parse as a date? end |
#size ⇒ Object
Returns the size if available or nil.
98 99 100 |
# File 'lib/smail/mime/content_fields.rb', line 98 def size self.params['size'] end |
#to_s ⇒ Object
Returns the Content-Disposition as a string suitable for inclusion in an email header. If no disposition type is specified it will default to a disposition type of ‘attachment’.
107 108 109 |
# File 'lib/smail/mime/content_fields.rb', line 107 def to_s "#{self.type_raw || 'attachment'}#{self.params.to_s}" end |