Sha256: 4ec8d8d62a9c7559eb7ce5f780f298ec93d4224193721109e63345e9d4586911

Contents?: true

Size: 905 Bytes

Versions: 10

Compression:

Stored size: 905 Bytes

Contents

module Internals

  module Index

    class Files < Backend

      def initialize bundle_name, category
        super bundle_name, category

        # Note: We marshal the similarity, as the
        #       Yajl json lib cannot load symbolized
        #       values, just keys.
        #
        @index         = File::JSON.new    category.index_path(bundle_name, :index)
        @weights       = File::JSON.new    category.index_path(bundle_name, :weights)
        @similarity    = File::Marshal.new category.index_path(bundle_name, :similarity)
        @configuration = File::JSON.new    category.index_path(bundle_name, :configuration)
      end

      def to_s
        <<-FILES
Files:
#{"Index:      #{@index}".indented_to_s}
#{"Weights:    #{@weights}".indented_to_s}
#{"Similarity: #{@similarity}".indented_to_s}
#{"Config:     #{@configuration}".indented_to_s}
FILES
      end

    end

  end

end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
picky-2.5.2 lib/picky/internals/index/files.rb
picky-2.5.1 lib/picky/internals/index/files.rb
picky-2.5.0 lib/picky/internals/index/files.rb
picky-2.4.3 lib/picky/internals/index/files.rb
picky-2.4.2 lib/picky/internals/index/files.rb
picky-2.4.1 lib/picky/internals/index/files.rb
picky-2.4.0 lib/picky/internals/index/files.rb
picky-2.3.0 lib/picky/internals/index/files.rb
picky-2.2.1 lib/picky/internals/index/files.rb
picky-2.2.0 lib/picky/internals/index/files.rb