Class: Rack::Session::Cookie::Base64::ZipJSON

Inherits:
Rack::Session::Cookie::Base64 show all
Defined in:
lib/rack/session/cookie.rb

Instance Method Summary collapse

Instance Method Details

#decode(str) ⇒ Object



88
89
90
91
92
93
# 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) ⇒ Object



84
85
86
# File 'lib/rack/session/cookie.rb', line 84

def encode(obj)
  super(Zlib::Deflate.deflate(::Rack::Utils::OkJson.encode(obj)))
end