Class: Mail::ContentTransferEncodingField
- Inherits:
-
StructuredField
- Object
- StructuredField
- Mail::ContentTransferEncodingField
- Defined in:
- lib/mail/fields/content_transfer_encoding_field.rb
Constant Summary collapse
- FIELD_NAME =
'content-transfer-encoding'
- CAPITALIZED_FIELD =
'Content-Transfer-Encoding'
Instance Method Summary collapse
- #decoded ⇒ Object
- #element ⇒ Object
-
#encoded ⇒ Object
TODO: Fix this up.
- #encoding ⇒ Object
-
#initialize(*args) ⇒ ContentTransferEncodingField
constructor
A new instance of ContentTransferEncodingField.
- #parse(val = value) ⇒ Object
- #tree ⇒ Object
Methods inherited from StructuredField
Methods included from Utilities
Methods included from CommonField
Constructor Details
#initialize(*args) ⇒ ContentTransferEncodingField
Returns a new instance of ContentTransferEncodingField.
11 12 13 |
# File 'lib/mail/fields/content_transfer_encoding_field.rb', line 11 def initialize(*args) super(CAPITALIZED_FIELD, strip_field(FIELD_NAME, args.last.to_s.downcase)) end |
Instance Method Details
#decoded ⇒ Object
40 41 42 |
# File 'lib/mail/fields/content_transfer_encoding_field.rb', line 40 def decoded value end |
#element ⇒ Object
27 28 29 |
# File 'lib/mail/fields/content_transfer_encoding_field.rb', line 27 def element @element ||= Mail::ContentTransferEncodingElement.new(value) end |
#encoded ⇒ Object
TODO: Fix this up
36 37 38 |
# File 'lib/mail/fields/content_transfer_encoding_field.rb', line 36 def encoded "#{CAPITALIZED_FIELD}: #{value}\r\n" end |
#encoding ⇒ Object
31 32 33 |
# File 'lib/mail/fields/content_transfer_encoding_field.rb', line 31 def encoding element.encoding end |
#parse(val = value) ⇒ Object
15 16 17 18 19 20 |
# File 'lib/mail/fields/content_transfer_encoding_field.rb', line 15 def parse(val = value) unless val.blank? @element = Mail::ContentTransferEncodingElement.new(val) @tree = @element.tree end end |
#tree ⇒ Object
22 23 24 25 |
# File 'lib/mail/fields/content_transfer_encoding_field.rb', line 22 def tree @element ||= Mail::ContentTransferEncodingElement.new(value) @tree ||= @element.tree end |