Class: Mail::StructuredField
- Inherits:
-
Object
- Object
- Mail::StructuredField
- Includes:
- CommonField, Utilities
- Defined in:
- lib/mail/fields/structured_field.rb
Overview
Provides access to a structured header field
Per RFC 2822:
2.2.2. Structured Header Field Bodies
Some field bodies in this standard have specific syntactical
structure more restrictive than the unstructured field bodies
described above. These are referred to as "structured" field bodies.
Structured field bodies are sequences of specific lexical tokens as
described in sections 3 and 4 of this standard. Many of these tokens
are allowed (according to their syntax) to be introduced or end with
comments (as described in section 3.2.3) as well as the space (SP,
ASCII value 32) and horizontal tab (HTAB, ASCII value 9) characters
(together known as the white space characters, WSP), and those WSP
characters are subject to header "folding" and "unfolding" as
described in section 2.2.3. Semantic analysis of structured field
bodies is given along with their syntax.
Direct Known Subclasses
BccField, CcField, ContentDispositionField, ContentIdField, ContentLocationField, ContentTransferEncodingField, ContentTypeField, DateField, Envelope, FromField, InReplyToField, KeywordsField, MessageIdField, MimeVersionField, ReceivedField, ReferencesField, ReplyToField, ResentBccField, ResentCcField, ResentDateField, ResentFromField, ResentMessageIdField, ResentSenderField, ResentToField, ReturnPathField, SenderField, ToField
Constant Summary
Constants included from Utilities
Utilities::CRLF, Utilities::LF, Utilities::TO_CRLF_REGEX
Constants included from Constants
Constants::ASTERISK, Constants::ATOM_UNSAFE, Constants::B_VALUES, Constants::CAPITAL_M, Constants::COLON, Constants::CONTROL_CHAR, Constants::CR, Constants::CRLF, Constants::CR_ENCODED, Constants::EMPTY, Constants::ENCODED_VALUE, Constants::EQUAL_LF, Constants::FIELD_BODY, Constants::FIELD_LINE, Constants::FIELD_NAME, Constants::FIELD_PREFIX, Constants::FIELD_SPLIT, Constants::FULL_ENCODED_VALUE, Constants::FWS, Constants::HEADER_LINE, Constants::HEADER_SPLIT, Constants::HYPHEN, Constants::LF, Constants::LF_ENCODED, Constants::NULL_SENDER, Constants::PHRASE_UNSAFE, Constants::QP_SAFE, Constants::QP_UNSAFE, Constants::Q_VALUES, Constants::SPACE, Constants::TEXT, Constants::TOKEN_UNSAFE, Constants::UNDERSCORE, Constants::WSP
Instance Method Summary collapse
- #charset ⇒ Object
- #charset=(val) ⇒ Object
- #default ⇒ Object
- #errors ⇒ Object
-
#initialize(name = nil, value = nil, charset = nil) ⇒ StructuredField
constructor
A new instance of StructuredField.
Methods included from Utilities
#atom_safe?, binary_unsafe_to_crlf, binary_unsafe_to_lf, blank?, #bracket, #capitalize_field, #constantize, #dasherize, #dquote, #escape_paren, #map_lines, #map_with_index, #match_to_s, #paren, #quote_atom, #quote_phrase, #quote_token, safe_for_line_ending_conversion?, to_crlf, to_lf, #token_safe?, #unbracket, #underscoreize, unescape, #unparen, unquote, #uri_escape, #uri_parser, #uri_unescape
Methods included from CommonField
#field_length, #name, #name=, #responsible_for?, #to_s, #value, #value=
Constructor Details
#initialize(name = nil, value = nil, charset = nil) ⇒ StructuredField
Returns a new instance of StructuredField.
28 29 30 31 32 33 |
# File 'lib/mail/fields/structured_field.rb', line 28 def initialize(name = nil, value = nil, charset = nil) self.name = name self.value = value self.charset = charset self end |
Instance Method Details
#charset ⇒ Object
35 36 37 |
# File 'lib/mail/fields/structured_field.rb', line 35 def charset @charset end |
#charset=(val) ⇒ Object
39 40 41 |
# File 'lib/mail/fields/structured_field.rb', line 39 def charset=(val) @charset = val end |
#default ⇒ Object
43 44 45 |
# File 'lib/mail/fields/structured_field.rb', line 43 def default decoded end |
#errors ⇒ Object
47 48 49 |
# File 'lib/mail/fields/structured_field.rb', line 47 def errors [] end |