Module: LimitedRed::Gzip
- Defined in:
- lib/limited_red/gzip.rb
Defined Under Namespace
Classes: Stream
Class Method Summary collapse
Class Method Details
.compress(source) ⇒ Object
10 11 12 13 14 15 16 |
# File 'lib/limited_red/gzip.rb', line 10 def self.compress(source) output = Stream.new gz = Zlib::GzipWriter.new(output) gz.write(source) gz.close output.string end |
.decompress(source) ⇒ Object
18 19 20 |
# File 'lib/limited_red/gzip.rb', line 18 def self.decompress(source) Zlib::GzipReader.new(StringIO.new(source)).read end |