Sha256: 48f2eb9a56c0201752382e4cf515b4dbb1a7194283cb5ffe92ffaa4030baf371

Contents?: true

Size: 680 Bytes

Versions: 1

Compression:

Stored size: 680 Bytes

Contents

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

1 entries across 1 versions & 1 rubygems

Version Path
thinking-sphinx-3.1.1 lib/thinking_sphinx/masks/group_enumerators_mask.rb