[Groonga-commit] groonga/fluent-plugin-droonga at c77f690 [master] table_create: change command to instance variable

Back to archive index

Kosuke Asami null+****@clear*****
Thu Jul 11 16:35:18 JST 2013


Kosuke Asami	2013-07-11 16:35:18 +0900 (Thu, 11 Jul 2013)

  New Revision: c77f690b45d9ea11babd0844ee47bd4d949bb0f2
  https://github.com/groonga/fluent-plugin-droonga/commit/c77f690b45d9ea11babd0844ee47bd4d949bb0f2

  Message:
    table_create: change command to instance variable

  Modified files:
    lib/droonga/plugin/groonga/table_create.rb

  Modified: lib/droonga/plugin/groonga/table_create.rb (+23 -23)
===================================================================
--- lib/droonga/plugin/groonga/table_create.rb    2013-07-11 16:32:11 +0900 (6c66b1e)
+++ lib/droonga/plugin/groonga/table_create.rb    2013-07-11 16:35:18 +0900 (115e755)
@@ -36,12 +36,12 @@ module Droonga
         @start_time = Time.now.to_f
 
         command_class = Groonga::Command.find("table_create")
-        command = command_class.new("table_create", request)
+        @command = command_class.new("table_create", request)
 
-        name = command["name"]
+        name = @command["name"]
         return [header(Status::INVALID_ARGUMENT, "Should not create anonymous table"), false] unless name
 
-        options = parse_command(command)
+        options = parse_command
         Groonga::Schema.define(:context => @context) do |schema|
           schema.create_table(name, options)
         end
@@ -49,50 +49,50 @@ module Droonga
       end
 
       private
-      def parse_command(command)
+      def parse_command
         options = {}
-        parse_flags(options, command)
-        parse_key_type(options, command)
-        parse_value_type(options, command)
-        parse_default_tokenizer(options, command)
-        parse_normalizer(options, command)
+        parse_flags(options)
+        parse_key_type(options)
+        parse_value_type(options)
+        parse_default_tokenizer(options)
+        parse_normalizer(options)
         options
       end
 
-      def parse_flags(options, command)
+      def parse_flags(options)
         options[:type] = :hash
-        if command.table_no_key?
+        if****@comma*****_no_key?
           options[:type] = :array
-        elsif command.table_hash_key?
+        elsif****@comma*****_hash_key?
           options[:type] = :hash
-        elsif command.table_pat_key?
+        elsif****@comma*****_pat_key?
           options[:type] = :patricia_trie
-        elsif command.table_dat_key?
+        elsif****@comma*****_dat_key?
           options[:type] = :double_array_trie
         end
-        if command.key_with_sis? and command.table_pat_key?
+        if****@comma*****_with_sis? and****@comma*****_pat_key?
           options[:key_with_sis] = true
         end
         options
       end
 
-      def parse_key_type(options, command)
-        options[:key_type] = command["key_type"] if command["key_type"]
+      def parse_key_type(options)
+        options[:key_type] = @command["key_type"] if @command["key_type"]
         options
       end
 
-      def parse_value_type(options, command)
-        options[:value_type] = command["value_type"] if command["value_type"]
+      def parse_value_type(options)
+        options[:value_type] = @command["value_type"] if @command["value_type"]
         options
       end
 
-      def parse_default_tokenizer(options, command)
-        options[:default_tokenizer] = command["default_tokenizer"] if command["default_tokenizer"]
+      def parse_default_tokenizer(options)
+        options[:default_tokenizer] = @command["default_tokenizer"] if @command["default_tokenizer"]
         options
       end
 
-      def parse_normalizer(options, command)
-        options[:normalizer] = command["normalizer"] if command["normalizer"]
+      def parse_normalizer(options)
+        options[:normalizer] = @command["normalizer"] if @command["normalizer"]
         options
       end
     end
-------------- next part --------------
HTML����������������������������...
Download 



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