Class: RedisClient::Decorator::Client

Inherits:
Object
  • Object
show all
Includes:
CommandsMixin
Defined in:
lib/redis_client/decorator.rb

Instance Method Summary collapse

Constructor Details

#initialize(_client) ⇒ Client

Returns a new instance of Client.



40
41
42
43
# File 'lib/redis_client/decorator.rb', line 40

def initialize(_client)
  super
  @_pipeline_class = self.class::Pipeline
end

Instance Method Details

#multi(**kwargs) ⇒ Object



54
55
56
# File 'lib/redis_client/decorator.rb', line 54

def multi(**kwargs)
  @client.multi(**kwargs) { |p| yield @_pipeline_class.new(p) }
end

#pipelined(exception: true) ⇒ Object



50
51
52
# File 'lib/redis_client/decorator.rb', line 50

def pipelined(exception: true)
  @client.pipelined(exception: exception) { |p| yield @_pipeline_class.new(p) }
end

#with(*args) ⇒ Object



45
46
47
# File 'lib/redis_client/decorator.rb', line 45

def with(*args)
  @client.with(*args) { |c| yield self.class.new(c) }
end