Permalink
Browse files

add example to AS::Gzip

  • Loading branch information...
Francesco Rodriguez
Francesco Rodriguez committed Jun 5, 2012
1 parent 4072de2 commit 20ded911c0ce7647c73822491eaf8db10e615844
Showing with 8 additions and 1 deletion.
  1. +8 −1 activesupport/lib/active_support/gzip.rb
@@ -2,7 +2,14 @@
require 'stringio'
module ActiveSupport
- # A convenient wrapper for the zlib standard library that allows compression/decompression of strings with gzip.
+ # A convenient wrapper for the zlib standard library that allows
+ # compression/decompression of strings with gzip.
+ #
+ # gzip = ActiveSupport::Gzip.compress('compress me!')
+ # # => "\x1F\x8B\b\x00o\x8D\xCDO\x00\x03K\xCE\xCF-(J-.V\xC8MU\x04\x00R>n\x83\f\x00\x00\x00"
+ #
+ # ActiveSupport::Gzip.decompress(gzip)
+ # # => "compress me!"
module Gzip
class Stream < StringIO
def initialize(*)

0 comments on commit 20ded91

Please sign in to comment.