Class: ArtirixCacheService::VariablesStores::Redis

Inherits:
Base
  • Object
show all
Defined in:
lib/artirix_cache_service/variables_stores/redis.rb

Constant Summary collapse

EMPTY_STRING =
''.freeze
WILDCARD =
'*'.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#variable_get, #variable_set

Constructor Details

#initialize(redis_variable_prefix:, redis_client:, redis_options: {}) ⇒ Redis

Returns a new instance of Redis.



14
15
16
17
18
# File 'lib/artirix_cache_service/variables_stores/redis.rb', line 14

def initialize(redis_variable_prefix:, redis_client:, redis_options: {})
  @redis_variable_prefix = redis_variable_prefix
  @redis_options         = redis_options
  @redis_client          = redis_client
end

Instance Attribute Details

#redis_clientObject (readonly)

Returns the value of attribute redis_client.



8
9
10
# File 'lib/artirix_cache_service/variables_stores/redis.rb', line 8

def redis_client
  @redis_client
end

#redis_variable_prefixObject (readonly)

Returns the value of attribute redis_variable_prefix.



8
9
10
# File 'lib/artirix_cache_service/variables_stores/redis.rb', line 8

def redis_variable_prefix
  @redis_variable_prefix
end

Instance Method Details

#typeObject



10
11
12
# File 'lib/artirix_cache_service/variables_stores/redis.rb', line 10

def type
  :redis
end

#variablesObject



20
21
22
# File 'lib/artirix_cache_service/variables_stores/redis.rb', line 20

def variables
  list.map { |key| clean_listed_variable key }
end