Sha256: 761cf1a09c348d57be92177201c93dc873123160229bc817396bb46814aa36d4
Contents?: true
Size: 590 Bytes
Versions: 6
Compression:
Stored size: 590 Bytes
Contents
module SpiffyStoresApp class InMemorySessionStore class EnvironmentError < StandardError; end def self.retrieve(id) repo[id] end def self.store(session) id = SecureRandom.uuid repo[id] = session id end def self.clear @@repo = nil end def self.repo if Rails.env.production? raise EnvironmentError.new("Cannot use InMemorySessionStore in a Production environment. \ Please initialize SpiffyStoresApp with a model that can store and retrieve sessions") end @@repo ||= {} end end end
Version data entries
6 entries across 6 versions & 1 rubygems