Class: Kredis::Types::Proxying

Inherits:
Object
  • Object
show all
Defined in:
lib/kredis/types/proxying.rb

Direct Known Subclasses

Counter, Enum, Flag, List, Scalar, Set, Slots

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(redis, key, **options) ⇒ Proxying

Returns a new instance of Proxying.



10
11
12
13
14
# File 'lib/kredis/types/proxying.rb', line 10

def initialize(redis, key, **options)
  @redis, @key = redis, key
  @proxy = Kredis::Types::Proxy.new(redis, key)
  options.each { |key, value| send("#{key}=", value) }
end

Instance Attribute Details

#keyObject

Returns the value of attribute key.



4
5
6
# File 'lib/kredis/types/proxying.rb', line 4

def key
  @key
end

#proxyObject

Returns the value of attribute proxy.



4
5
6
# File 'lib/kredis/types/proxying.rb', line 4

def proxy
  @proxy
end

#redisObject

Returns the value of attribute redis.



4
5
6
# File 'lib/kredis/types/proxying.rb', line 4

def redis
  @redis
end

Class Method Details

.proxying(*commands) ⇒ Object



6
7
8
# File 'lib/kredis/types/proxying.rb', line 6

def self.proxying(*commands)
  delegate *commands, to: :proxy
end