class Mail::ContentTransferEncodingField
Constants
- CAPITALIZED_FIELD
- FIELD_NAME
Public Class Methods
new(value = nil, charset = 'utf-8')
click to toggle source
Calls superclass method
# File lib/mail/fields/content_transfer_encoding_field.rb, line 10 def initialize(value = nil, charset = 'utf-8') self.charset = charset value = '7bit' if value.to_s =~ /7-?bits?/i value = '8bit' if value.to_s =~ /8-?bits?/i super(CAPITALIZED_FIELD, strip_field(FIELD_NAME, value), charset) self.parse self end
Public Instance Methods
decoded()
click to toggle source
# File lib/mail/fields/content_transfer_encoding_field.rb, line 38 def decoded encoding end
element()
click to toggle source
# File lib/mail/fields/content_transfer_encoding_field.rb, line 25 def element @element ||= Mail::ContentTransferEncodingElement.new(value) end
encoded()
click to toggle source
TODO: Fix this up
# File lib/mail/fields/content_transfer_encoding_field.rb, line 34 def encoded "#{CAPITALIZED_FIELD}: #{encoding}\r\n" end
encoding()
click to toggle source
# File lib/mail/fields/content_transfer_encoding_field.rb, line 29 def encoding element.encoding end
parse(val = value)
click to toggle source
# File lib/mail/fields/content_transfer_encoding_field.rb, line 19 def parse(val = value) unless val.blank? @element = Mail::ContentTransferEncodingElement.new(val) end end