Sha256: 87729b0a8ab0f147e8eeb19bcc5033a502d66d3d067839a0d24fad47db28065c

Contents?: true

Size: 1.58 KB

Versions: 8

Compression:

Stored size: 1.58 KB

Contents

module Mack
  module SessionStore
    
    class << self
      
      def store # :nodoc:
        ivar_cache do
          "Mack::SessionStore::#{configatron.mack.session_store.camelcase}".constantize
        end
      end
      
      # Calls the get method on the specified session store.
      def get(*args)
        self.store.get(*args)
      end
      
      # Calls the set method on the specified session store.
      def set(*args)
        self.store.set(*args)
      end
      
      # Calls the expire method on the specified session store.
      def expire(*args)
        self.store.expire(*args)
      end
      
      # Calls the expire_all method on the specified session store.
      def expire_all(*args)
        self.store.expire_all(*args)
      end
      
    end
    
    class Base

      class << self
    
        # Needs to be defined by the subclass. Raises NoMethodError.
        def get(id, request, response, cookies)
          raise NoMethodError.new("get")
        end
        
        # Needs to be defined by the subclass. Raises NoMethodError.
        def set(id, request, response, cookies)
          raise NoMethodError.new("set")
        end
        
        # Needs to be defined by the subclass. Raises NoMethodError.
        def expire(id, request, response, cookies)
          raise NoMethodError.new("expire")
        end
        
        # Needs to be defined by the subclass. Raises NoMethodError.
        def expire_all(request, response, cookies)
          raise NoMethodError.new("expire_all")
        end
      
      end
      
    end # Base
  end # SessionStore
end # Mack

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
mack-0.8.0.100 lib/mack/sessions/session_store_base.rb
mack-0.8.0.101 lib/mack/sessions/session_store_base.rb
mack-0.8.2 lib/mack/sessions/session_store_base.rb
mack-0.8.0 lib/mack/sessions/session_store_base.rb
mack-0.8.0.2 lib/mack/sessions/session_store_base.rb
mack-0.8.1 lib/mack/sessions/session_store_base.rb
mack-0.8.3 lib/mack/sessions/session_store_base.rb
mack-0.8.3.1 lib/mack/sessions/session_store_base.rb