Class: Kredis::Types::Proxying
- Inherits:
-
Object
- Object
- Kredis::Types::Proxying
show all
- Defined in:
- lib/kredis/types/proxying.rb
Instance Attribute Summary collapse
Class Method Summary
collapse
Instance Method Summary
collapse
Constructor Details
#initialize(redis, key, **options) ⇒ Proxying
12
13
14
15
16
17
|
# File 'lib/kredis/types/proxying.rb', line 12
def initialize(redis, key, **options)
@redis = redis
@key = key
@proxy = Kredis::Types::Proxy.new(redis, key)
options.each { |key, value| send("#{key}=", value) }
end
|
Instance Attribute Details
#key ⇒ Object
Returns the value of attribute key.
6
7
8
|
# File 'lib/kredis/types/proxying.rb', line 6
def key
@key
end
|
#proxy ⇒ Object
Returns the value of attribute proxy.
6
7
8
|
# File 'lib/kredis/types/proxying.rb', line 6
def proxy
@proxy
end
|
Class Method Details
.proxying(*commands) ⇒ Object
8
9
10
|
# File 'lib/kredis/types/proxying.rb', line 8
def self.proxying(*commands)
delegate(*commands, to: :proxy)
end
|
Instance Method Details
#failsafe(returning: nil, &block) ⇒ Object
19
20
21
|
# File 'lib/kredis/types/proxying.rb', line 19
def failsafe(returning: nil, &block)
proxy.suppress_failsafe_with(returning: returning, &block)
end
|
#unproxied_redis ⇒ Object
23
24
25
26
27
|
# File 'lib/kredis/types/proxying.rb', line 23
def unproxied_redis
@redis
end
|