Sha256: 2c1f6e96d811e33b8cb9ab4f6429dd00bc04a6522bb74de66f1bdf9696a88dfb
Contents?: true
Size: 839 Bytes
Versions: 11
Compression:
Stored size: 839 Bytes
Contents
module ShopifyApp 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, *args) storage.store(session, *args) end def storage load_storage || raise(ConfigurationError.new("ShopifySessionRepository.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
11 entries across 11 versions & 1 rubygems