summaryrefslogtreecommitdiff
path: root/lib/gitlab/namespaced_session_store.rb
blob: 34520078bfb36a96cf43902530c39b359d6ceb69 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# frozen_string_literal: true

module Gitlab
  class NamespacedSessionStore
    delegate :[], :[]=, to: :store

    def initialize(key)
      @key = key
    end

    def initiated?
      !Session.current.nil?
    end

    def store
      return unless Session.current

      Session.current[@key] ||= {}
      Session.current[@key]
    end
  end
end