Class: Gitlab::Session

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

Constant Summary collapse

STORE_KEY =
:session_storage

Class Method Summary collapse

Class Method Details

.currentObject


16
17
18
# File 'lib/gitlab/session.rb', line 16

def current
  Thread.current[STORE_KEY]
end

.with_session(session) ⇒ Object


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

def with_session(session)
  old = self.current
  self.current = session
  yield
ensure
  self.current = old
end