Class: Redis::Wrap

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

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#keyObject (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

#redisObject



17
18
19
# File 'lib/redis/wrap.rb', line 17

def redis
  Redis.current
end