debian-mirror-gitlab/lib/gitlab/namespaced_session_store.rb
2019-09-30 21:07:59 +05:30

27 lines
409 B
Ruby

# 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