Class: Flipper::Serializers::Gzip
- Inherits:
-
Object
- Object
- Flipper::Serializers::Gzip
- Defined in:
- lib/flipper/serializers/gzip.rb
Class Method Summary collapse
Class Method Details
.deserialize(source) ⇒ Object
16 17 18 19 |
# File 'lib/flipper/serializers/gzip.rb', line 16 def self.deserialize(source) return if source.nil? Zlib::GzipReader.wrap(StringIO.new(source), &:read) end |
.serialize(source) ⇒ Object
7 8 9 10 11 12 13 14 |
# File 'lib/flipper/serializers/gzip.rb', line 7 def self.serialize(source) return if source.nil? output = StringIO.new gz = Zlib::GzipWriter.new(output) gz.write(source) gz.close output.string end |