Module: Redic::Connection

Defined in:
lib/redic/connection.rb

Class Method Summary collapse

Class Method Details

.new(uri, timeout) ⇒ Object


5
6
7
8
9
10
11
12
13
14
15
# File 'lib/redic/connection.rb', line 5

def self.new(uri, timeout)
  connection = Hiredis::Connection.new

  if uri.scheme == "unix"
    connection.connect_unix(uri.path, timeout)
  else
    connection.connect(uri.host, uri.port, timeout)
  end

  connection
end