Sha256: fcbbe855ce35de30e28735d725d022478d62f05f17f618664f1c5633983c035a
Contents?: true
Size: 724 Bytes
Versions: 6
Compression:
Stored size: 724 Bytes
Contents
class RedisFactory class << self def create(*addresses) addresses = extract_addresses(addresses) if addresses.size > 1 DistributedMarshaledRedis.new addresses else MarshaledRedis.new addresses.first || {} end end private def extract_addresses(addresses) addresses = addresses.flatten.compact addresses.inject([]) do |result, address| host, port = address.split /\:/ port, db = port.split /\// if port address = {} address[:host] = host if host address[:port] = port if port address[:db] = db.to_i if db result << address result end end end end
Version data entries
6 entries across 6 versions & 3 rubygems