class Rack::Session::Cookie::Base64::ZipJSON - rack-1.6.4 Documentation

# class Rack::Session::Cookie::Base64::ZipJSON

### Public Instance Methods

decode(str) click to toggle source
Calls superclass method Rack::Session::Cookie::Base64#decode

    # File lib/rack/session/cookie.rb, line 88
    def decode(str)
      return unless str
      ::Rack::Utils::OkJson.decode(Zlib::Inflate.inflate(super(str)))
    rescue
      nil
    end

encode(obj) click to toggle source
Calls superclass method Rack::Session::Cookie::Base64#encode

    # File lib/rack/session/cookie.rb, line 84
    def encode(obj)
      super(Zlib::Deflate.deflate(::Rack::Utils::OkJson.encode(obj)))
    end