Sha256: 623f9e034cad3913d382e8457ad61df58cbc9c7762d1b05fcad712db481f117d

Contents?: true

Size: 420 Bytes

Versions: 31

Compression:

Stored size: 420 Bytes

Contents

require 'asir'

require 'zlib'

module ASIR
  class Coder
    class Zlib < self
      attr_accessor :compression_level

      def _encode obj
        raise TypeError unless String === obj
        ::Zlib::Deflate.deflate(obj, @compression_level || ::Zlib::DEFAULT_COMPRESSION)
      end
      def _decode obj
        raise TypeError unless String === obj
        ::Zlib::Inflate.inflate(obj)
      end
    end
  end
end

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
asir-1.2.11 lib/asir/coder/zlib.rb
asir-1.2.10 lib/asir/coder/zlib.rb
asir-1.2.9 lib/asir/coder/zlib.rb
asir-1.2.8 lib/asir/coder/zlib.rb
asir-1.2.7 lib/asir/coder/zlib.rb
asir-1.2.6 lib/asir/coder/zlib.rb
asir-1.2.5 lib/asir/coder/zlib.rb
asir-1.2.3 lib/asir/coder/zlib.rb
asir-1.2.2 lib/asir/coder/zlib.rb
asir-1.2.1 lib/asir/coder/zlib.rb
asir-1.2.0 lib/asir/coder/zlib.rb
asir-1.1.12 lib/asir/coder/zlib.rb
asir-1.1.11 lib/asir/coder/zlib.rb
asir-1.1.10 lib/asir/coder/zlib.rb
asir-1.1.9 lib/asir/coder/zlib.rb
asir-1.1.8 lib/asir/coder/zlib.rb
asir-1.1.7 lib/asir/coder/zlib.rb
asir-1.1.6 lib/asir/coder/zlib.rb
asir-1.1.5 lib/asir/coder/zlib.rb
asir-1.1.4 lib/asir/coder/zlib.rb