Sha256: 532ca0f64ccdd5db54b997603e53698ac8937575f37118e103efd0b125f9f8a2

Contents?: true

Size: 963 Bytes

Versions: 10

Compression:

Stored size: 963 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, category, *args
          super name, category, *args

          @backend = Internals::Index::Redis.new name, category
        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
        # Settings of this bundle can be accessed via [].
        #
        def [] sym
          @backend.setting sym
        end

      end

    end

  end

end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
picky-2.5.2 lib/picky/internals/indexed/bundle/redis.rb
picky-2.5.1 lib/picky/internals/indexed/bundle/redis.rb
picky-2.5.0 lib/picky/internals/indexed/bundle/redis.rb
picky-2.4.3 lib/picky/internals/indexed/bundle/redis.rb
picky-2.4.2 lib/picky/internals/indexed/bundle/redis.rb
picky-2.4.1 lib/picky/internals/indexed/bundle/redis.rb
picky-2.4.0 lib/picky/internals/indexed/bundle/redis.rb
picky-2.3.0 lib/picky/internals/indexed/bundle/redis.rb
picky-2.2.1 lib/picky/internals/indexed/bundle/redis.rb
picky-2.2.0 lib/picky/internals/indexed/bundle/redis.rb