Sha256: 1475e6a5dbbb9efa4f9d8dbc7f402b5600e3411ae92cf02d5c2d5e64944a9f50

Contents?: true

Size: 508 Bytes

Versions: 17

Compression:

Stored size: 508 Bytes

Contents

# encoding: UTF-8


module Spontaneous::Search
  class CompoundIndexer
    def initialize(revision, indexes)
      @revision, @indexes, @dbs = revision, indexes, indexes.map { |index| index.create_db(revision) }
    end

    def length
      @indexes.length
    end
    alias_method :count, :length
    alias_method :size,  :length

    def add(page)
      @dbs.each { |db| db << page }
    end

    alias_method :<<, :add

    def close
      @dbs.each { |db| db.close }
    end
  end # CompoundIndexer
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
spontaneous-0.2.0.beta10 lib/spontaneous/search/compound_indexer.rb
spontaneous-0.2.0.beta9 lib/spontaneous/search/compound_indexer.rb
spontaneous-0.2.0.beta8 lib/spontaneous/search/compound_indexer.rb
spontaneous-0.2.0.beta7 lib/spontaneous/search/compound_indexer.rb
spontaneous-0.2.0.beta6 lib/spontaneous/search/compound_indexer.rb
spontaneous-0.2.0.beta5 lib/spontaneous/search/compound_indexer.rb
spontaneous-0.2.0.beta4 lib/spontaneous/search/compound_indexer.rb
spontaneous-0.2.0.beta3 lib/spontaneous/search/compound_indexer.rb
spontaneous-0.2.0.beta2 lib/spontaneous/search/compound_indexer.rb
spontaneous-0.2.0.beta1 lib/spontaneous/search/compound_indexer.rb
spontaneous-0.2.0.alpha7 lib/spontaneous/search/compound_indexer.rb
spontaneous-0.2.0.alpha6 lib/spontaneous/search/compound_indexer.rb
spontaneous-0.2.0.alpha5 lib/spontaneous/search/compound_indexer.rb
spontaneous-0.2.0.alpha4 lib/spontaneous/search/compound_indexer.rb
spontaneous-0.2.0.alpha3 lib/spontaneous/search/compound_indexer.rb
spontaneous-0.2.0.alpha2 lib/spontaneous/search/compound_indexer.rb
spontaneous-0.2.0.alpha1 lib/spontaneous/search/compound_indexer.rb