Sha256: 3bd5042abd8d70a65d4d975fa0a75f90ab33b811cad5d7656e811a76864a702a

Contents?: true

Size: 543 Bytes

Versions: 126

Compression:

Stored size: 543 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.to_s.downcase)
        @encoding = tree.encoding.text_value
      else
        raise Mail::Field::ParseError.new(ContentTransferEncodingElement, string, parser.failure_reason)
      end
    end
    
    def encoding
      @encoding
    end
    
  end
end

Version data entries

126 entries across 114 versions & 13 rubygems

Version Path
mail-2.5.5 lib/mail/elements/content_transfer_encoding_element.rb
mail-2.5.5.rc1 lib/mail/elements/content_transfer_encoding_element.rb
classiccms-0.7.5 vendor/bundle/gems/mail-2.4.4/lib/mail/elements/content_transfer_encoding_element.rb
classiccms-0.7.4 vendor/bundle/gems/mail-2.4.4/lib/mail/elements/content_transfer_encoding_element.rb
classiccms-0.7.3 vendor/bundle/gems/mail-2.4.4/lib/mail/elements/content_transfer_encoding_element.rb
active_mailer-0.0.10 test/fixtures/dummyapp_rails_3.2/vendor/bundle/ruby/1.9.1/gems/mail-2.4.4/lib/mail/elements/content_transfer_encoding_element.rb
judge-2.0.5 vendor/bundle/ruby/2.1.0/gems/mail-2.4.4/lib/mail/elements/content_transfer_encoding_element.rb
challah-1.0.0 vendor/bundle/gems/mail-2.5.4/lib/mail/elements/content_transfer_encoding_element.rb
classiccms-0.7.2 vendor/bundle/gems/mail-2.4.4/lib/mail/elements/content_transfer_encoding_element.rb
classiccms-0.7.1 vendor/bundle/gems/mail-2.4.4/lib/mail/elements/content_transfer_encoding_element.rb
swipe-rails-0.0.5 vendor/bundle/gems/mail-2.5.4/lib/mail/elements/content_transfer_encoding_element.rb
active_mailer-0.0.9 test/fixtures/dummyapp_rails_3.2/vendor/bundle/ruby/1.9.1/gems/mail-2.4.4/lib/mail/elements/content_transfer_encoding_element.rb
active_mailer-0.0.8 test/fixtures/dummyapp_rails_3.2/vendor/bundle/ruby/1.9.1/gems/mail-2.4.4/lib/mail/elements/content_transfer_encoding_element.rb
active_mailer-0.0.7 test/fixtures/dummyapp_rails_3.2/vendor/bundle/ruby/1.9.1/gems/mail-2.4.4/lib/mail/elements/content_transfer_encoding_element.rb
active_mailer-0.0.6 test/fixtures/dummyapp_rails_3.2/vendor/bundle/ruby/1.9.1/gems/mail-2.4.4/lib/mail/elements/content_transfer_encoding_element.rb
classiccms-0.7.0 vendor/bundle/gems/mail-2.4.4/lib/mail/elements/content_transfer_encoding_element.rb
mail-2.5.4 lib/mail/elements/content_transfer_encoding_element.rb
challah-1.0.0.beta3 vendor/bundle/gems/mail-2.5.3/lib/mail/elements/content_transfer_encoding_element.rb
fc-webicons-0.0.4 vendor/bundle/ruby/1.9.1/gems/mail-2.5.3/lib/mail/elements/content_transfer_encoding_element.rb
challah-1.0.0.beta2 vendor/bundle/gems/mail-2.5.3/lib/mail/elements/content_transfer_encoding_element.rb