Sha256: 336caae956a3097c9a4161725ec9b1dbbf79d1eee34912804981fd3fc8c0f402

Contents?: true

Size: 1.04 KB

Versions: 21

Compression:

Stored size: 1.04 KB

Contents

# encoding: utf-8
#
module Indexed # :nodoc:all

  # This is the _actual_ index.
  #
  # Handles exact/partial index, weights index, and similarity index.
  #
  # Delegates file handling and checking to an *Indexed*::*Files* object.
  #
  class Bundle < Index::Bundle
    
    # Get the ids for the given symbol.
    #
    def ids sym
      @index[sym] || []
    end
    # Get a weight for the given symbol.
    #
    def weight sym
      @weights[sym]
    end
    
    # Loads all indexes.
    #
    def load
      load_index
      load_weights
      load_similarity
      load_configuration
    end
    # Loads the core index.
    #
    def load_index
      self.index = files.load_index
    end
    # Loads the weights index.
    #
    def load_weights
      self.weights = files.load_weights
    end
    # Loads the similarity index.
    #
    def load_similarity
      self.similarity = files.load_similarity
    end
    # Loads the configuration.
    #
    def load_configuration
      self.configuration = files.load_configuration
    end
    
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
picky-1.4.1 lib/picky/indexed/bundle.rb
picky-1.4.0 lib/picky/indexed/bundle.rb
picky-1.3.4 lib/picky/indexed/bundle.rb
picky-1.3.3 lib/picky/indexed/bundle.rb
picky-1.3.2 lib/picky/indexed/bundle.rb
picky-1.3.1 lib/picky/indexed/bundle.rb
picky-1.3.0 lib/picky/indexed/bundle.rb
picky-1.2.4 lib/picky/indexed/bundle.rb
picky-1.2.3 lib/picky/indexed/bundle.rb
picky-1.2.2 lib/picky/indexed/bundle.rb
picky-1.2.1 lib/picky/indexed/bundle.rb
picky-1.2.0 lib/picky/indexed/bundle.rb
picky-1.1.7 lib/picky/indexed/bundle.rb
picky-1.1.6 lib/picky/indexed/bundle.rb
picky-1.1.5 lib/picky/indexed/bundle.rb
picky-1.1.4 lib/picky/indexed/bundle.rb
picky-1.1.3 lib/picky/indexed/bundle.rb
picky-1.1.2 lib/picky/indexed/bundle.rb
picky-1.1.1 lib/picky/indexed/bundle.rb
picky-1.1.0 lib/picky/indexed/bundle.rb