Class: Gitlab::NamespacedSessionStore
- Inherits:
-
Object
- Object
- Gitlab::NamespacedSessionStore
- Defined in:
- lib/gitlab/namespaced_session_store.rb
Instance Method Summary collapse
-
#initialize(key, session = Session.current) ⇒ NamespacedSessionStore
constructor
A new instance of NamespacedSessionStore.
- #initiated? ⇒ Boolean
- #store ⇒ Object
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
12 13 14 |
# File 'lib/gitlab/namespaced_session_store.rb', line 12 def initiated? !session.nil? end |
#store ⇒ Object
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 |