Module: Kredis::Namespace

Included in:
Kredis
Defined in:
lib/kredis/namespace.rb

Instance Method Summary collapse

Instance Method Details

#namespaceObject



8
9
10
# File 'lib/kredis/namespace.rb', line 8

def namespace
  Thread.current[:kredis_namespace]
end

#namespace=(namespace) ⇒ Object



4
5
6
# File 'lib/kredis/namespace.rb', line 4

def namespace=(namespace)
  Thread.current[:kredis_namespace] = namespace
end

#namespaced_key(key) ⇒ Object



12
13
14
# File 'lib/kredis/namespace.rb', line 12

def namespaced_key(key)
  namespace ? "#{namespace}:#{key}" : key
end