Sha256: 922c5b65c75039d81ca0477d90c6c5a4c3cdfa3ee7b1cc97f9a74635e40af052

Contents?: true

Size: 462 Bytes

Versions: 2

Compression:

Stored size: 462 Bytes

Contents

module Picky

  class Categories

    each_delegate :remove,
                  :to => :categories

    # TODO Rewrite indexing/tokenizer/caching etc.
    #
    def add object
      id = object.id
      categories.each do |category|
        tokens, _ = category.tokenizer.tokenize object.send(category.from).to_s
        category.add id, tokens
      end
    end

    # TODO
    #
    def replace object
      remove object.id
      add object
    end

  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
picky-3.1.11 lib/picky/categories_realtime.rb
picky-3.1.10 lib/picky/categories_realtime.rb