Sha256: c756d424e80e6d0278b77d4c9ab0c255d3562ec2174c9ad2bac4141af8bfc293
Contents?: true
Size: 1.15 KB
Versions: 16
Compression:
Stored size: 1.15 KB
Contents
module Shamu module Sessions # Exposes a persistent key/value store to track state across multiple # requests. module SessionStore def self.create( scorpion, *args, **dependencies, &block ) return scorpion.fetch Shamu::Sessions::CookieStore, *args, **dependencies, &block if defined? Rack fail "Configure a Shamu::Sessions::SessionStore in your scorpion setup." end # Fetch the value with the given key from the store. If they key does not # yet exist, yields to the block and caches the result. # # @param [String] key # @yieldreturn The calculated value of the key. # @return [Object] def fetch( key, &block ) fail NotImplementedError end # Save a named value in the session. # # @param [String] key # @param [Object] value. Must be a primitive (String, Number, Hash, Array). # @return [value] def set( key, value ) fail NotImplementedError end # Remove the value with the given key. # @param [String] key # @return [nil] def delete( key ) fail NotImplementedError end end end end
Version data entries
16 entries across 16 versions & 1 rubygems