Class: Nest
- Inherits:
-
Object
- Object
- Nest
- Defined in:
- lib/nest.rb
Instance Method Summary collapse
- #[](key) ⇒ Object
- #call(command, *args) ⇒ Object
- #hash ⇒ Object
-
#initialize(ns, rc = Redic.new) ⇒ Nest
constructor
A new instance of Nest.
- #inspect ⇒ Object
- #redis ⇒ Object
- #to_s ⇒ Object
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 |
#hash ⇒ Object
37 38 39 |
# File 'lib/nest.rb', line 37 def hash @ns.hash end |
#inspect ⇒ Object
49 50 51 |
# File 'lib/nest.rb', line 49 def inspect @ns.inspect end |
#redis ⇒ Object
33 34 35 |
# File 'lib/nest.rb', line 33 def redis @rc end |
#to_s ⇒ Object
41 42 43 |
# File 'lib/nest.rb', line 41 def to_s @ns end |