Sha256: 69e08d0e31dda813ff30422c4496e98cf89641862fe3976faac0bf0896d055da

Contents?: true

Size: 571 Bytes

Versions: 4

Compression:

Stored size: 571 Bytes

Contents

# encoding: utf-8
module Mail
  class ContentTransferEncodingElement
    
    include Mail::Utilities
    
    def initialize( string )
      parser = Mail::ContentTransferEncodingParser.new
      case
      when string.blank?
        @encoding = ''
      when tree = parser.parse(string.downcase)
        @encoding = tree.encoding.text_value
      else
        raise Mail::Field::ParseError, "ContentTransferEncodingElement can not parse |#{string}|\nReason was: #{parser.failure_reason}\n"
      end
    end
    
    def encoding
      @encoding
    end
    
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
mail-2.1.5.3 lib/mail/elements/content_transfer_encoding_element.rb
mail-2.1.5.2 lib/mail/elements/content_transfer_encoding_element.rb
mail-2.1.5.1 lib/mail/elements/content_transfer_encoding_element.rb
mail-2.1.5 lib/mail/elements/content_transfer_encoding_element.rb