Sha256: 7e23ab0899244ca5546b9cc5543aee12aa7b1be808f9fb18299a07ae92899c18

Contents?: true

Size: 698 Bytes

Versions: 8

Compression:

Stored size: 698 Bytes

Contents

# encoding: utf-8
#
module Index

  # 
  #
  class Combined < Bundle
    
    delegate :similar,
             :identifier,
             :name,
             :to => :@full
    delegate :type,
             :category,
             :weight,
             :generate_partial_from,
             :generate_caches_from_memory,
             :generate_derived,
             :dump,
             :load,
             :to => :@partial
    
    def initialize full, partial
      @full    = full
      @partial = partial
    end
    
    def ids text
      @full.ids(text) + @partial.ids(text)
    end
    
    def weight text
      [@full.weight(text) || 0, @partial.weight(text) || 0].max
    end
    
  end
  
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
picky-0.0.9 lib/picky/index/combined.rb
picky-0.0.8 lib/picky/index/combined.rb
picky-0.0.7 lib/picky/index/combined.rb
picky-0.0.6 lib/picky/index/combined.rb
picky-0.0.5 lib/picky/index/combined.rb
picky-0.0.4 lib/picky/index/combined.rb
picky-0.0.3 lib/picky/index/combined.rb
picky-0.0.2 lib/picky/index/combined.rb