Sha256: 4b1f91daa9f5db41b5474b03db7443225f7c91a658467d8df53d595d6cbdd07c

Contents?: true

Size: 489 Bytes

Versions: 2

Compression:

Stored size: 489 Bytes

Contents

require "active_support/core_ext/module/delegation"

class Kredis::Types::Proxying
  attr_accessor :proxy, :redis, :key

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

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

  private
    delegate :type_to_string, :string_to_type, :types_to_strings, :strings_to_types, to: :Kredis
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
kredis-0.2.1 lib/kredis/types/proxying.rb
kredis-0.2.0 lib/kredis/types/proxying.rb