Class: Mail::UnstructuredField
- Inherits:
-
Object
- Object
- Mail::UnstructuredField
- Includes:
- CommonField, Utilities
- Defined in:
- lib/mail/fields/unstructured_field.rb
Overview
Provides access to an unstructured header field
Per RFC 2822:
2.2.1. Unstructured Header Field Bodies
Some field bodies in this standard are defined simply as
"unstructured" (which is specified below as any US-ASCII characters,
except for CR and LF) with no further restrictions. These are
referred to as unstructured field bodies. Semantically, unstructured
field bodies are simply to be treated as a single line of characters
with no further processing (except for header "folding" and
"unfolding" as described in section 2.2.3).
Direct Known Subclasses
CommentsField, ContentDescriptionField, OptionalField, SubjectField
Instance Method Summary collapse
- #decoded ⇒ Object
- #default ⇒ Object
- #encoded ⇒ Object
-
#initialize(*args) ⇒ UnstructuredField
constructor
A new instance of UnstructuredField.
-
#parse ⇒ Object
An unstructured field does not parse.
Methods included from Utilities
Methods included from CommonField
Constructor Details
#initialize(*args) ⇒ UnstructuredField
Returns a new instance of UnstructuredField.
20 21 22 23 24 |
# File 'lib/mail/fields/unstructured_field.rb', line 20 def initialize(*args) self.name = args.first self.value = args.last self end |
Instance Method Details
#decoded ⇒ Object
30 31 32 |
# File 'lib/mail/fields/unstructured_field.rb', line 30 def decoded do_decode end |
#default ⇒ Object
34 35 36 |
# File 'lib/mail/fields/unstructured_field.rb', line 34 def default decoded end |
#encoded ⇒ Object
26 27 28 |
# File 'lib/mail/fields/unstructured_field.rb', line 26 def encoded do_encode(self.name) end |
#parse ⇒ Object
An unstructured field does not parse
38 39 40 |
# File 'lib/mail/fields/unstructured_field.rb', line 38 def parse # An unstructured field does not parse self end |