Class: Redis::Factory
- Inherits:
-
Object
- Object
- Redis::Factory
- Defined in:
- lib/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/factory.rb', line 15 def self.() 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/factory.rb', line 3 def self.create(*) = .flatten.compact.inject([]) do |result, address| result << (address) result end if .size > 1 DistributedMarshaled.new else MarshaledClient.new .first || {} end end |