Class: ThinkingSphinx::Masks::WeightEnumeratorMask
- Inherits:
-
Object
- Object
- ThinkingSphinx::Masks::WeightEnumeratorMask
- Defined in:
- lib/thinking_sphinx/masks/weight_enumerator_mask.rb
Instance Method Summary collapse
- #can_handle?(method) ⇒ Boolean
- #each_with_weight(&block) ⇒ Object
-
#initialize(search) ⇒ WeightEnumeratorMask
constructor
A new instance of WeightEnumeratorMask.
Constructor Details
#initialize(search) ⇒ WeightEnumeratorMask
Returns a new instance of WeightEnumeratorMask.
4 5 6 |
# File 'lib/thinking_sphinx/masks/weight_enumerator_mask.rb', line 4 def initialize(search) @search = search end |
Instance Method Details
#can_handle?(method) ⇒ Boolean
8 9 10 |
# File 'lib/thinking_sphinx/masks/weight_enumerator_mask.rb', line 8 def can_handle?(method) public_methods(false).include?(method) end |
#each_with_weight(&block) ⇒ Object
12 13 14 15 16 |
# File 'lib/thinking_sphinx/masks/weight_enumerator_mask.rb', line 12 def each_with_weight(&block) @search.raw.each_with_index do |row, index| yield @search[index], row["weight()"] end end |