Module: UnifiedRedis::Adapter
- Defined in:
- lib/unified_redis/adapter.rb,
lib/unified_redis/adapters/redis.rb,
lib/unified_redis/adapters/emredis.rb
Defined Under Namespace
Class Method Summary collapse
-
.adapters ⇒ Object
List of available adapters.
- .get_adapter(redis) ⇒ Object
Class Method Details
.adapters ⇒ Object
List of available adapters
4 5 6 7 8 9 |
# File 'lib/unified_redis/adapter.rb', line 4 def self.adapters { 'Redis' => "Redis", 'EventMachine::Protocols::Redis::EM_CONNECTION_CLASS' => 'EMRedis' } end |
.get_adapter(redis) ⇒ Object
11 12 13 14 15 16 |
# File 'lib/unified_redis/adapter.rb', line 11 def self.get_adapter(redis) adapter = self.adapters[redis.class.to_s] raise "Adapter not found" if adapter.nil? require "unified_redis/adapters/#{adapter.downcase}" Adapter.const_get(adapter).new(redis) end |