[Groonga-commit] droonga/droonga-engine at 417333c [master] Support initializer options correctly

Back to archive index

YUKI Hiroshi null+****@clear*****
Fri Jun 27 23:41:36 JST 2014


YUKI Hiroshi	2014-06-27 23:41:36 +0900 (Fri, 27 Jun 2014)

  New Revision: 417333c9ad387e5f466b33bb0ea4b8b86658e980
  https://github.com/droonga/droonga-engine/commit/417333c9ad387e5f466b33bb0ea4b8b86658e980

  Message:
    Support initializer options correctly

  Modified files:
    lib/droonga/catalog_generator.rb

  Modified: lib/droonga/catalog_generator.rb (+7 -13)
===================================================================
--- lib/droonga/catalog_generator.rb    2014-06-27 23:35:19 +0900 (fa7415b)
+++ lib/droonga/catalog_generator.rb    2014-06-27 23:41:36 +0900 (671bb33)
@@ -25,27 +25,21 @@ module Droonga
     DEFAULT_TAG = "droonga"
 
     class << self
-      def new(datasets_params=nil)
-        generator = super
-
-        if datasets_params
-          datasets_params.each do |name, params|
-            generator.add_dataset(name, params)
-          end
-        end
-
-        generator
-      end
-
       def generate(datasets_params)
         new(datasets_params).generate
       end
     end
 
-    def initialize
+    def initialize(datasets_params=nil)
       @version = 2
       @effective_date = Time.now
       @datasets = {}
+
+      if datasets_params
+        datasets_params.each do |name, params|
+          add_dataset(name, params)
+        end
+      end
     end
 
     def add_dataset(name, options)
-------------- next part --------------
HTML����������������������������...
Descargar 



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