Sha256: 92b13609a7645e4b25f97b8a3053e094df104698ab3901c12a7acb2e9066eb61

Contents?: true

Size: 978 Bytes

Versions: 2

Compression:

Stored size: 978 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
        # Settings of this bundle can be accessed via [].
        #
        def [] sym
          @backend.setting sym
        end

      end

    end

  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
picky-2.1.2 lib/picky/internals/indexed/bundle/redis.rb
picky-2.1.1 lib/picky/internals/indexed/bundle/redis.rb