Sha256: 3f6249393ed89d0868e7735e6c3c6f092dc5c1b15343f16fbcecb9e5da8a3d40

Contents?: true

Size: 566 Bytes

Versions: 239

Compression:

Stored size: 566 Bytes

Contents

# encoding: utf-8
require 'mail/encodings/binary'

module Mail
  module Encodings
    class EightBit < Binary
      NAME = '8bit'

      PRIORITY = 4

      # 8bit is an identiy encoding, meaning nothing to do
      
      # Decode the string
      def self.decode(str)
        str.to_lf
      end
    
      # Encode the string
      def self.encode(str)
        str.to_crlf
      end
     
      # Idenity encodings have a fixed cost, 1 byte out per 1 byte in
      def self.cost(str)
        1.0
      end

      Encodings.register(NAME, self) 
    end
  end
end

Version data entries

239 entries across 196 versions & 23 rubygems

Version Path
mail-2.5.5 lib/mail/encodings/8bit.rb
mail-2.5.5.rc1 lib/mail/encodings/8bit.rb
angular-rails4-templates-0.4.1 vendor/ruby/2.1.0/gems/mail-2.6.3/lib/mail/encodings/8bit.rb
angular-rails4-templates-0.4.0 vendor/ruby/2.1.0/gems/mail-2.6.3/lib/mail/encodings/8bit.rb
tdiary-4.2.1 vendor/bundle/ruby/2.3.0/gems/mail-2.6.3/lib/mail/encodings/8bit.rb
tdiary-4.2.1 vendor/bundle/ruby/2.2.0/gems/mail-2.6.3/lib/mail/encodings/8bit.rb
angular-rails4-templates-0.3.0 vendor/ruby/2.1.0/gems/mail-2.6.3/lib/mail/encodings/8bit.rb
sc_core-0.0.7 test/dummy/vendor/bundle/ruby/2.2.0/gems/mail-2.6.3/lib/mail/encodings/8bit.rb
classiccms-0.7.5 vendor/bundle/gems/mail-2.4.4/lib/mail/encodings/8bit.rb
classiccms-0.7.4 vendor/bundle/gems/mail-2.4.4/lib/mail/encodings/8bit.rb
classiccms-0.7.3 vendor/bundle/gems/mail-2.4.4/lib/mail/encodings/8bit.rb
solidus_backend-1.0.0.pre3 vendor/bundle/gems/mail-2.6.3/lib/mail/encodings/8bit.rb
solidus_backend-1.0.0.pre2 vendor/bundle/gems/mail-2.6.3/lib/mail/encodings/8bit.rb
solidus_backend-1.0.0.pre vendor/bundle/gems/mail-2.6.3/lib/mail/encodings/8bit.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/encodings/8bit.rb
shoppe-paypal-1.1.0 vendor/bundle/ruby/2.1.0/gems/mail-2.6.3/lib/mail/encodings/8bit.rb
judge-2.0.5 vendor/bundle/ruby/2.1.0/gems/mail-2.4.4/lib/mail/encodings/8bit.rb
mail-2.6.3 lib/mail/encodings/8bit.rb
mail-portertech-2.6.2.edge lib/mail/encodings/8bit.rb
mail-2.6.1 lib/mail/encodings/8bit.rb