Sha256: 58f0a1f70f1b3c1f99be6aea05994fb52cd5738f8bdbb7ddb00fea9dbddef049

Contents?: true

Size: 458 Bytes

Versions: 1

Compression:

Stored size: 458 Bytes

Contents

require 'redis'

module Legion
  module Extensions
    module Redis
      module Helpers
        module Client
          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
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
lex-redis-0.1.1 lib/legion/extensions/redis/helpers/client.rb