Class: Redis::Wrap
- Inherits:
-
Object
- Object
- Redis::Wrap
- Defined in:
- lib/redis/wrap.rb
Instance Attribute Summary collapse
-
#key ⇒ Object
(also: #to_s)
readonly
Returns the value of attribute key.
Instance Method Summary collapse
-
#initialize(key) ⇒ Wrap
constructor
A new instance of Wrap.
- #method_missing(command, *arguments, &block) ⇒ Object
- #redis ⇒ Object
Constructor Details
#initialize(key) ⇒ Wrap
Returns a new instance of Wrap.
9 10 11 |
# File 'lib/redis/wrap.rb', line 9 def initialize(key) @key = key.to_s end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(command, *arguments, &block) ⇒ Object
13 14 15 |
# File 'lib/redis/wrap.rb', line 13 def method_missing(command, *arguments, &block) redis.send(command, key, *arguments, &block) end |
Instance Attribute Details
#key ⇒ Object (readonly) Also known as: to_s
Returns the value of attribute key.
7 8 9 |
# File 'lib/redis/wrap.rb', line 7 def key @key end |
Instance Method Details
#redis ⇒ Object
17 18 19 |
# File 'lib/redis/wrap.rb', line 17 def redis Redis.current end |