Module: TrickSerial::Serializer::CgiSession

Defined in:
lib/trick_serial/serializer/cgi_session.rb

Overview

Support for ::CGI::Session stores.

Stores for use with CGI::Session and TrickSerial::Serializer::CgiSession::Store must implement #_data and #_data= to get access to the underlying Hash structure.

Defined Under Namespace

Modules: CassandraStoreSerializer, FileStoreSerializer, MemCacheStoreSerializer, PStoreSerializer, SessionSerializer, SessionStoreDataHook Classes: Store

Class Method Summary collapse

Class Method Details

.activate!Object



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/trick_serial/serializer/cgi_session.rb', line 11

def self.activate!
  require 'cgi/session'
  require 'cgi/session/pstore'

  ::CGI::Session.send(:include, SessionSerializer)

  if defined? ::CGI::Session::FileStore
    ::CGI::Session::FileStore.send(:include, FileStoreSerializer)
  end
  if defined? ::CGI::Session::PStore
    ::CGI::Session::PStore.send(:include, PStoreSerializer)
  end
  if defined? ::CGI::Session::MemCacheStore
    ::CGI::Session::MemCacheStore.send(:include, MemCacheStoreSerializer)
  end
  if defined? ::CGI::Session::CassandraStore
    ::CGI::Session::CassandraStore.send(:include, CassandraStoreSerializer)
  end
end