Module: Legion::Extensions::Redis::Helpers::Client

Included in:
Runners::Item, Runners::Server
Defined in:
lib/legion/extensions/redis/helpers/client.rb

Class Method Summary collapse

Class Method Details

.client(host: '127.0.0.1', port: 6380, **opts) ⇒ Object



8
9
10
11
12
13
# File 'lib/legion/extensions/redis/helpers/client.rb', line 8

def self.client(host: '127.0.0.1', port: 6380, **opts)
  connect_hash = { host: host, port: port }
  connect_hash[:db] = opts[:db] if opts.key? :db
  connect_hash[:password] = opts[:password] if opts.key? :password
  Redis.new(**connect_hash)
end