Sha256: 869796d24fa9b616f95b19f8979ec4997a1f9c8e168a8d4bb6a93b533d17e009

Contents?: true

Size: 711 Bytes

Versions: 17

Compression:

Stored size: 711 Bytes

Contents

# frozen_string_literal: true

class ThinkingSphinx::Masks::GroupEnumeratorsMask
  def initialize(search)
    @search = search
  end

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

  def each_with_count(&block)
    @search.raw.each_with_index do |row, index|
      yield @search[index], row["sphinx_internal_count"]
    end
  end

  def each_with_group(&block)
    @search.raw.each_with_index do |row, index|
      yield @search[index], row["sphinx_internal_group"]
    end
  end

  def each_with_group_and_count(&block)
    @search.raw.each_with_index do |row, index|
      yield @search[index], row["sphinx_internal_group"],
        row["sphinx_internal_count"]
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
thinking-sphinx-5.6.0 lib/thinking_sphinx/masks/group_enumerators_mask.rb
thinking-sphinx-5.5.1 lib/thinking_sphinx/masks/group_enumerators_mask.rb
thinking-sphinx-5.5.0 lib/thinking_sphinx/masks/group_enumerators_mask.rb
thinking-sphinx-5.4.0 lib/thinking_sphinx/masks/group_enumerators_mask.rb
thinking-sphinx-5.3.0 lib/thinking_sphinx/masks/group_enumerators_mask.rb
thinking-sphinx-5.2.1 lib/thinking_sphinx/masks/group_enumerators_mask.rb
thinking-sphinx-5.2.0 lib/thinking_sphinx/masks/group_enumerators_mask.rb
thinking-sphinx-5.1.0 lib/thinking_sphinx/masks/group_enumerators_mask.rb
thinking-sphinx-5.0.0 lib/thinking_sphinx/masks/group_enumerators_mask.rb
thinking-sphinx-4.4.1 lib/thinking_sphinx/masks/group_enumerators_mask.rb
thinking-sphinx-4.4.0 lib/thinking_sphinx/masks/group_enumerators_mask.rb
thinking-sphinx-4.3.2 lib/thinking_sphinx/masks/group_enumerators_mask.rb
thinking-sphinx-4.3.1 lib/thinking_sphinx/masks/group_enumerators_mask.rb
thinking-sphinx-4.3.0 lib/thinking_sphinx/masks/group_enumerators_mask.rb
thinking-sphinx-4.2.0 lib/thinking_sphinx/masks/group_enumerators_mask.rb
thinking-sphinx-4.1.0 lib/thinking_sphinx/masks/group_enumerators_mask.rb
thinking-sphinx-4.0.0 lib/thinking_sphinx/masks/group_enumerators_mask.rb