Module: RedisPrescription::Adapters::RedisNamespace

Defined in:
lib/redis_prescription/adapters/redis_namespace.rb

Overview

redis-namespace adapter

Class Method Summary collapse

Class Method Details

.adapts?(redis) ⇒ Boolean

Returns:

  • (Boolean)


10
11
12
# File 'lib/redis_prescription/adapters/redis_namespace.rb', line 10

def adapts?(redis)
  defined?(::Redis::Namespace) && redis.is_a?(::Redis::Namespace)
end

.eval(redis, script, keys, argv) ⇒ Object



14
15
16
17
18
# File 'lib/redis_prescription/adapters/redis_namespace.rb', line 14

def eval(redis, script, keys, argv)
  redis.eval(script, keys, argv)
rescue ::Redis::CommandError => e
  raise CommandError, e.message
end

.evalsha(redis, digest, keys, argv) ⇒ Object



20
21
22
23
24
# File 'lib/redis_prescription/adapters/redis_namespace.rb', line 20

def evalsha(redis, digest, keys, argv)
  redis.evalsha(digest, keys, argv)
rescue ::Redis::CommandError => e
  raise CommandError, e.message
end