[Groonga-commit] droonga/droonga-engine at 70d3cfd [master] Simplify

Back to archive index

Kouhei Sutou null+****@clear*****
Sat Jun 28 23:07:34 JST 2014


Kouhei Sutou	2014-06-28 23:07:34 +0900 (Sat, 28 Jun 2014)

  New Revision: 70d3cfd39a0a45dee92dd797eb7bf1143415e545
  https://github.com/droonga/droonga-engine/commit/70d3cfd39a0a45dee92dd797eb7bf1143415e545

  Message:
    Simplify

  Modified files:
    lib/droonga/catalog_generator.rb

  Modified: lib/droonga/catalog_generator.rb (+6 -8)
===================================================================
--- lib/droonga/catalog_generator.rb    2014-06-28 23:04:28 +0900 (beb699a)
+++ lib/droonga/catalog_generator.rb    2014-06-28 23:07:34 +0900 (c6d3c58)
@@ -27,7 +27,11 @@ module Droonga
 
     class << self
       def generate(datasets_params)
-        new(datasets_params).generate
+        generator = new
+        datasets_params.each do |name, params|
+          add_dataset(name, params)
+        end
+        generator.generate
       end
 
       def update_params(base_params, modifications)
@@ -48,16 +52,10 @@ module Droonga
       end
     end
 
-    def initialize(datasets_params=nil)
+    def initialize
       @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����������������������������...
Download 



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