Sha256: 01c760702af6eb91d94db3adab130c34d5f312d42125327745f2ec333eb31d12

Contents?: true

Size: 728 Bytes

Versions: 3

Compression:

Stored size: 728 Bytes

Contents

# encoding: utf-8
# 
# 
# 
module Mail
  class ContentTransferEncodingField < StructuredField
    
    FIELD_NAME = 'content-transfer-encoding'
    CAPITALIZED_FIELD = 'Content-Transfer-Encoding'
    
    def initialize(*args)
      super(CAPITALIZED_FIELD, strip_field(FIELD_NAME, args.last.to_s.downcase))
    end
    
    def tree
      @element ||= ContentTransferEncodingElement.new(value)
      @tree ||= @element.tree
    end
    
    def element
      @element ||= ContentTransferEncodingElement.new(value)
    end
    
    def encoding
      element.encoding
    end
    
    # TODO: Fix this up
    def encoded
      "#{CAPITALIZED_FIELD}: #{value}\r\n"
    end
    
    def decoded
      value
    end
    
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
mail-1.5.2 lib/mail/fields/content_transfer_encoding_field.rb
mail-1.5.1 lib/mail/fields/content_transfer_encoding_field.rb
mail-1.5.0 lib/mail/fields/content_transfer_encoding_field.rb