Sha256: ef48953bfe3a0bc61d9cdaae7ca3fe1426ae7fa8e9bd4a015f0a36ba54d17233

Contents?: true

Size: 575 Bytes

Versions: 241

Compression:

Stored size: 575 Bytes

Contents

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

module Mail
  module Encodings
    class Binary < TransferEncoding
      NAME = 'binary'

      PRIORITY = 5

      # Binary is an identiy encoding, meaning nothing to do
      
      # Decode the string
      def self.decode(str)
        str
      end
    
      # Encode the string
      def self.encode(str)
        str
      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

241 entries across 198 versions & 23 rubygems

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