[Groonga-commit] groonga/groonga-command at 35d6161 [fix-travis-ci-error] Remove Base#to_hash

Back to archive index

Kouhei Sutou null+****@clear*****
Wed Jan 13 17:20:56 JST 2016


Kouhei Sutou	2013-09-13 10:52:08 +0900 (Fri, 13 Sep 2013)

  New Revision: 35d61613d48a471274b591ed3e55e2a928e186db
  https://github.com/groonga/groonga-command/commit/35d61613d48a471274b591ed3e55e2a928e186db

  Message:
    Remove Base#to_hash
    
    Use Base#arguments instead.

  Modified files:
    lib/groonga/command/base.rb
    test/command/test-base.rb

  Modified: lib/groonga/command/base.rb (+0 -10)
===================================================================
--- lib/groonga/command/base.rb    2013-09-12 19:12:46 +0900 (deaedcd)
+++ lib/groonga/command/base.rb    2013-09-13 10:52:08 +0900 (6fc4e68)
@@ -117,16 +117,6 @@ module Groonga
         command_line.join(" ")
       end
 
-      def to_hash
-        converted_hash = {}
-        self.class.parameter_names.each do |parameter|
-          unless self[parameter].nil?
-            converted_hash[parameter] = self[parameter]
-          end
-        end
-        converted_hash
-      end
-
       private
       def construct_arguments(pair_arguments, ordered_arguments)
         arguments = {}

  Modified: test/command/test-base.rb (+0 -25)
===================================================================
--- test/command/test-base.rb    2013-09-12 19:12:46 +0900 (1882aa7)
+++ test/command/test-base.rb    2013-09-13 10:52:08 +0900 (9d316c7)
@@ -83,31 +83,6 @@ class BaseCommandTest < Test::Unit::TestCase
     end
   end
 
-  class CovnertToHashTest < self
-    class TemporaryCommand < Groonga::Command::Base
-      Groonga::Command.register("temporary_command", self)
-
-      class << self
-        def parameter_names
-          [
-            :parameter1,
-            :parameter2,
-            :parameter3,
-          ]
-        end
-      end
-    end
-
-    def test_convert
-      select = TemporaryCommand.new("temporary_command",
-                                    :parameter1 => "value1",
-                                    :parameter2 => "value2")
-      assert_equal({ :parameter1 => "value1",
-                     :parameter2 => "value2" },
-                   select.to_hash)
-    end
-  end
-
   sub_test_case("#[]") do
     def setup
       @table = "Users"
-------------- next part --------------
HTML����������������������������...
Télécharger 



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