Class: RedisFactory
- Inherits:
-
Object
- Object
- RedisFactory
- Defined in:
- lib/redis/redis_factory.rb
Class Method Summary collapse
- .convert_to_redis_client_options(address_or_options) ⇒ Object
- .create(*redis_client_options) ⇒ Object
Class Method Details
.convert_to_redis_client_options(address_or_options) ⇒ Object
15 16 17 18 19 20 21 22 23 24 |
# File 'lib/redis/redis_factory.rb', line 15 def () return if .is_a?(Hash) host, port = .split /\:/ port, db = port.split /\// if port = {} [:host] = host if host [:port] = port if port [:db] = db.to_i if db end |
.create(*redis_client_options) ⇒ Object
3 4 5 6 7 8 9 10 11 12 13 |
# File 'lib/redis/redis_factory.rb', line 3 def create(*) = .flatten.compact.inject([]) do |result, address| result << (address) result end if .size > 1 DistributedMarshaledRedis.new else MarshaledRedis.new .first || {} end end |