Class: Gitlab::NamespacedSessionStore

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

Instance Method Summary collapse

Constructor Details

#initialize(key, session = Session.current) ⇒ NamespacedSessionStore

Returns a new instance of NamespacedSessionStore.


7
8
9
10
# File 'lib/gitlab/namespaced_session_store.rb', line 7

def initialize(key, session = Session.current)
  @key = key
  @session = session
end

Instance Method Details

#initiated?Boolean

Returns:

  • (Boolean)

12
13
14
# File 'lib/gitlab/namespaced_session_store.rb', line 12

def initiated?
  !session.nil?
end

#storeObject


16
17
18
19
20
21
# File 'lib/gitlab/namespaced_session_store.rb', line 16

def store
  return unless session

  session[@key] ||= {}
  session[@key]
end