Sha256: bc58790b31ab0c3a8bd47a509c62c28980a12a3c48b491a5f93945715b9b3313
Contents?: true
Size: 835 Bytes
Versions: 6
Compression:
Stored size: 835 Bytes
Contents
module SpiffyStoresApp class SessionRepository class ConfigurationError < StandardError; end class << self def storage=(storage) @storage = storage unless storage.nil? || self.storage.respond_to?(:store) && self.storage.respond_to?(:retrieve) raise ArgumentError, "storage must respond to :store and :retrieve" end end def retrieve(id) storage.retrieve(id) end def store(session) storage.store(session) end def storage load_storage || raise(ConfigurationError.new("SpiffyStoresSessionRepository.storage is not configured!")) end private def load_storage return unless @storage @storage.respond_to?(:safe_constantize) ? @storage.safe_constantize : @storage end end end end
Version data entries
6 entries across 6 versions & 1 rubygems