gitlab-org--gitlab-foss/lib/gitlab/namespaced_session_store.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

28 lines
409 B
Ruby
Raw Normal View History

# frozen_string_literal: true
module Gitlab
class NamespacedSessionStore
delegate :[], :[]=, to: :store
def initialize(key, session = Session.current)
@key = key
@session = session
end
def initiated?
!session.nil?
end
def store
return unless session
session[@key] ||= {}
session[@key]
end
private
attr_reader :session
end
end