Sha256: 4a7d444edfa9174c850f8c3c3fca93d5cd3e2b480d011ed9ddc7931218998a6f

Contents?: true

Size: 428 Bytes

Versions: 1

Compression:

Stored size: 428 Bytes

Contents

module Tako
  class QueryChain
    attr_reader :proxy
    attr_reader :base_object

    def initialize(proxy, base_object)
      @proxy = proxy
      @base_object = base_object
    end

    def method_missing(method, *args)
      @proxy.in_proxy do
        base_object.send(method, *args)
      end
    end

    def shard(shard_name)
      new(
        Tako::Repository.shard(shard_name),
        self
      )
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
tako-0.1.0 lib/tako/query_chain.rb