Class: ThinkingSphinx::Masks::WeightEnumeratorMask

Inherits:
Object
  • Object
show all
Defined in:
lib/thinking_sphinx/masks/weight_enumerator_mask.rb

Instance Method Summary (collapse)

Constructor Details

- (WeightEnumeratorMask) initialize(search)



2
3
4
# File 'lib/thinking_sphinx/masks/weight_enumerator_mask.rb', line 2

def initialize(search)
  @search = search
end

Instance Method Details

- (Boolean) can_handle?(method)



6
7
8
# File 'lib/thinking_sphinx/masks/weight_enumerator_mask.rb', line 6

def can_handle?(method)
  public_methods(false).include?(method)
end

- (Object) each_with_weight(&block)



10
11
12
13
14
# File 'lib/thinking_sphinx/masks/weight_enumerator_mask.rb', line 10

def each_with_weight(&block)
  @search.raw.each_with_index do |row, index|
    yield @search[index], row['@weight']
  end
end