Class: ActiveSearch::Proxy

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Includes:
Enumerable
Defined in:
lib/activesearch/proxy.rb

Instance Method Summary collapse

Constructor Details

#initialize(results_set, text, options) ⇒ Proxy

Returns a new instance of Proxy.



11
12
13
14
15
# File 'lib/activesearch/proxy.rb', line 11

def initialize(results_set, text, options)
  @results_set    = results_set
  @text           = text
  @options        = options
end

Instance Method Details

#each(&block) ⇒ Object



17
18
19
20
21
22
# File 'lib/activesearch/proxy.rb', line 17

def each(&block)
  @results_set.results.map do |result|
    _result = @results_set.parse(result)
    block.call(Result.new(_result, @text, @options))
  end
end