Flowdock
method

gzip

Importance_1
v2_4_6 - Show latest stable - 0 notes - Class: Zlib
gzip(p1) public

Gzip the given string. Valid values of level are Zlib::NO_COMPRESSION, Zlib::BEST_SPEED, Zlib::BEST_COMPRESSION, Zlib::DEFAULT_COMPRESSION (default), or an integer from 0 to 9.

This method is almost equivalent to the following code:

def gzip(string, level: nil, strategy: nil)
  sio = StringIO.new
  sio.binmode
  gz = Zlib::GzipWriter.new(sio, level, strategy)
  gz.write(string)
  gz.close
  sio.string
end

See also Zlib.gunzip

Show source
Register or log in to add new notes.