mkb/riak-shim

View on GitHub
lib/riak-shim/secondary_index_query.rb

Summary

Maintainability
A
0 mins
Test Coverage
module Riak
  module Shim
    module Persistable
      class SecondaryIndexQuery
        def initialize(obj, idx)
          @obj = obj
          @idx = idx =~ /_bin$/ ? idx : "#{idx}_bin"
        end

        def [](key)
          @obj.for_index(@idx, key)
        end
      end
    end
  end
end