Sha256: 9f1cfcf435d3a17957bd37e9ad2f743aee40dcb73d01f0937339129d8912ca5d

Contents?: true

Size: 946 Bytes

Versions: 7

Compression:

Stored size: 946 Bytes

Contents

module Internals

  # encoding: utf-8
  #
  module Indexed # :nodoc:all

    #
    #
    module Bundle

      # This is the _actual_ index (based on Redis).
      #
      # Handles exact/partial index, weights index, and similarity index.
      #
      class Redis < Base

        def initialize name, configuration, *args
          super name, configuration, *args

          @backend = Internals::Index::Redis.new name, configuration
        end

        # Get the ids for the given symbol.
        #
        # Ids are an array of string values in Redis.
        #
        def ids sym
          @backend.ids sym
        end
        # Get a weight for the given symbol.
        #
        # A weight is a string value in Redis. TODO Convert?
        #
        def weight sym
          @backend.weight sym
        end
        # TODO Spec. Doc.
        #
        def [] sym
          @backend.setting sym
        end

      end

    end

  end

end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
picky-2.1.0 lib/picky/internals/indexed/bundle/redis.rb
picky-2.0.0 lib/picky/internals/indexed/bundle/redis.rb
picky-2.0.0.pre3 lib/picky/internals/indexed/bundle/redis.rb
picky-2.0.0.pre2 lib/picky/internals/indexed/bundle/redis.rb
picky-2.0.0.pre1 lib/picky/internals/indexed/bundle/redis.rb
picky-1.5.4 lib/picky/internals/indexed/bundle/redis.rb
picky-1.5.3 lib/picky/internals/indexed/bundle/redis.rb