Class: Nest

Inherits:
Object
  • Object
show all
Defined in:
lib/nest.rb

Instance Method Summary collapse

Constructor Details

#initialize(ns, rc = Redic.new) ⇒ Nest

Returns a new instance of Nest.



24
25
26
27
# File 'lib/nest.rb', line 24

def initialize(ns, rc = Redic.new)
  @ns = ns.to_s
  @rc = rc
end

Instance Method Details

#[](key) ⇒ Object



29
30
31
# File 'lib/nest.rb', line 29

def [](key)
  Nest.new("#{@ns}:#{key}", @rc)
end

#call(command, *args) ⇒ Object



45
46
47
# File 'lib/nest.rb', line 45

def call(command, *args)
  @rc.call(command, to_s, *args)
end

#hashObject



37
38
39
# File 'lib/nest.rb', line 37

def hash
  @ns.hash
end

#inspectObject



49
50
51
# File 'lib/nest.rb', line 49

def inspect
  @ns.inspect
end

#redisObject



33
34
35
# File 'lib/nest.rb', line 33

def redis
  @rc
end

#to_sObject



41
42
43
# File 'lib/nest.rb', line 41

def to_s
  @ns
end