Class: ThinkingSphinx::Middlewares::Inquirer::Inner
- Inherits:
-
Object
- Object
- ThinkingSphinx::Middlewares::Inquirer::Inner
- Defined in:
- lib/thinking_sphinx/middlewares/inquirer.rb
Instance Method Summary collapse
- #call(raw_results, meta_results) ⇒ Object
-
#initialize(context) ⇒ Inner
constructor
A new instance of Inner.
Constructor Details
#initialize(context) ⇒ Inner
Returns a new instance of Inner.
44 45 46 |
# File 'lib/thinking_sphinx/middlewares/inquirer.rb', line 44 def initialize(context) @context = context end |
Instance Method Details
#call(raw_results, meta_results) ⇒ Object
48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/thinking_sphinx/middlewares/inquirer.rb', line 48 def call(raw_results, ) context[:results] = raw_results.to_a context[:raw] = context[:results].dup context[:meta] = .inject({}) { |hash, row| hash[row['Variable_name']] = row['Value'] hash } total = context[:meta]['total_found'] ThinkingSphinx::Logger.log :message, "Found #{total} result#{'s' unless total == 1}" end |