[Groonga-commit] droonga/fluent-plugin-droonga at 7018734 [refactor-searcher] Add ResultFormatter

Back to archive index

Yoji Shidara null+****@clear*****
Thu Dec 19 16:06:52 JST 2013


Yoji Shidara	2013-12-19 16:06:52 +0900 (Thu, 19 Dec 2013)

  New Revision: 7018734e0e1075529016562733e646fc47b1ffdd
  https://github.com/droonga/fluent-plugin-droonga/commit/7018734e0e1075529016562733e646fc47b1ffdd

  Message:
    Add ResultFormatter

  Modified files:
    lib/droonga/searcher.rb

  Modified: lib/droonga/searcher.rb (+7 -2)
===================================================================
--- lib/droonga/searcher.rb    2013-12-19 15:48:38 +0900 (c8e5f47)
+++ lib/droonga/searcher.rb    2013-12-19 16:06:52 +0900 (235abff)
@@ -75,8 +75,7 @@ module Droonga
           if searcher.need_output?
             $log.trace("#{log_tag}: process_queries: format: start",
                        :name => name)
-            formatter = ResultFormatter.new(search_request, search_result)
-            outputs[name] = formatter.format
+            outputs[name] = ResultFormatter.format(search_request, search_result)
             $log.trace("#{log_tag}: process_queries: format: done",
                        :name => name)
           end
@@ -307,6 +306,12 @@ module Droonga
     end
 
     class ResultFormatter
+      class << self
+        def format(search_request, search_result)
+          new(search_request, search_result).format
+        end
+      end
+
       def initialize(search_request, search_result)
         @request = search_request
         @result = search_result
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index