Module: RedisPrescription::Adapters::Redis
- Defined in:
- lib/redis_prescription/adapters/redis.rb
Overview
redis-rb adapter
Class Method Summary collapse
- .adapts?(redis) ⇒ Boolean
- .eval(redis, script, keys, argv) ⇒ Object
- .evalsha(redis, digest, keys, argv) ⇒ Object
Class Method Details
.adapts?(redis) ⇒ Boolean
10 11 12 |
# File 'lib/redis_prescription/adapters/redis.rb', line 10 def adapts?(redis) defined?(::Redis) && redis.is_a?(::Redis) end |
.eval(redis, script, keys, argv) ⇒ Object
14 15 16 17 18 |
# File 'lib/redis_prescription/adapters/redis.rb', line 14 def eval(redis, script, keys, argv) redis.eval(script, keys, argv) rescue ::Redis::CommandError => e raise CommandError, e. end |
.evalsha(redis, digest, keys, argv) ⇒ Object
20 21 22 23 24 |
# File 'lib/redis_prescription/adapters/redis.rb', line 20 def evalsha(redis, digest, keys, argv) redis.evalsha(digest, keys, argv) rescue ::Redis::CommandError => e raise CommandError, e. end |