Class: Fett::RedisConnection
- Inherits:
-
Object
- Object
- Fett::RedisConnection
- Defined in:
- lib/fett/redis_connection.rb
Constant Summary collapse
- HOST =
ENV.fetch("FETT_REDIS_HOST")
- PORT =
ENV.fetch("FETT_REDIS_PORT")
- PASSWORD =
ENV.fetch("FETT_REDIS_PASSWORD")
- DATABASE =
ENV.fetch("FETT_REDIS_DATABASE")
Class Method Summary collapse
Class Method Details
.client ⇒ Object
16 17 18 |
# File 'lib/fett/redis_connection.rb', line 16 def self.client @@client end |
.initialize ⇒ Object
10 11 12 13 14 |
# File 'lib/fett/redis_connection.rb', line 10 def self.initialize params = { host: HOST, port: PORT, db: DATABASE } params.merge!(password: PASSWORD) unless PASSWORD.empty? @@client ||= ::Redis.new(params) end |