class Mail::ContentTransferEncodingElement - mail-2.5.4 Documentation

# class Mail::ContentTransferEncodingElement

### Public Class Methods

new( string ) click to toggle source

    # File lib/mail/elements/content_transfer_encoding_element.rb, line 6
    def initialize( string )
      parser = Mail::ContentTransferEncodingParser.new
      case
      when string.blank?
        @encoding = ''
      when tree = parser.parse(string.to_s.downcase)
        @encoding = tree.encoding.text_value
      else
        raise Mail::Field::ParseError.new(ContentTransferEncodingElement, string, parser.failure_reason)
      end
    end

### Public Instance Methods

encoding() click to toggle source

    # File lib/mail/elements/content_transfer_encoding_element.rb, line 18
    def encoding
      @encoding
    end