Sha256: 7e43bbfaa1de36ef95040ce422c670d87a5b16ed09f8b39da817ab64c97978c2

Contents?: true

Size: 724 Bytes

Versions: 15

Compression:

Stored size: 724 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

15 entries across 15 versions & 1 rubygems

Version Path
mail-1.4.3 lib/mail/fields/content_transfer_encoding_field.rb
mail-1.4.2 lib/mail/fields/content_transfer_encoding_field.rb
mail-1.4.1 lib/mail/fields/content_transfer_encoding_field.rb
mail-1.4.0 lib/mail/fields/content_transfer_encoding_field.rb
mail-1.3.5 lib/mail/fields/content_transfer_encoding_field.rb
mail-1.3.4 lib/mail/fields/content_transfer_encoding_field.rb
mail-1.3.3 lib/mail/fields/content_transfer_encoding_field.rb
mail-1.3.2 lib/mail/fields/content_transfer_encoding_field.rb
mail-1.3.1 lib/mail/fields/content_transfer_encoding_field.rb
mail-1.3.0 lib/mail/fields/content_transfer_encoding_field.rb
mail-1.2.9 lib/mail/fields/content_transfer_encoding_field.rb
mail-1.2.8 lib/mail/fields/content_transfer_encoding_field.rb
mail-1.2.6 lib/mail/fields/content_transfer_encoding_field.rb
mail-1.2.5 ./lib/mail/fields/content_transfer_encoding_field.rb
mail-1.2.1 ./lib/mail/fields/content_transfer_encoding_field.rb