Sha256: 8d3c41c2b96e4640b74407624997e07216ddd22171c5dfd78dd40c847163f78e

Contents?: true

Size: 857 Bytes

Versions: 1

Compression:

Stored size: 857 Bytes

Contents

# 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 = Backend::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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
picky-2.6.0 lib/picky/indexed/bundle/redis.rb