Class: DuodealerApp::SessionRepository

Inherits:
Object
  • Object
show all
Defined in:
lib/duodealer_app/session/session_repository.rb

Defined Under Namespace

Classes: ConfigurationError

Class Method Summary collapse

Class Method Details

.storageObject



22
23
24
# File 'lib/duodealer_app/session/session_repository.rb', line 22

def storage
  load_storage || raise(ConfigurationError.new("DuodealerSessionRepository.storage is not configured!"))
end

.storage=(storage) ⇒ Object



8
9
10
11
12
13
14
# File 'lib/duodealer_app/session/session_repository.rb', line 8

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

.store(session, *args) ⇒ Object



18
19
20
# File 'lib/duodealer_app/session/session_repository.rb', line 18

def store(session, *args)
  storage.store(session, *args)
end