[Groonga-commit] groonga/fluent-plugin-droonga at dbcba8e [master] Use support_key? predicate instead of comparison of classes by name

Back to archive index

Kosuke Asami null+****@clear*****
Mon Jul 22 13:00:19 JST 2013


Kosuke Asami	2013-07-22 13:00:19 +0900 (Mon, 22 Jul 2013)

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

  Message:
    Use support_key? predicate instead of comparison of classes by name

  Modified files:
    lib/droonga/plugin/handler_add.rb

  Modified: lib/droonga/plugin/handler_add.rb (+3 -3)
===================================================================
--- lib/droonga/plugin/handler_add.rb    2013-07-22 11:33:25 +0900 (7eefd9b)
+++ lib/droonga/plugin/handler_add.rb    2013-07-22 13:00:19 +0900 (32ec306)
@@ -33,10 +33,10 @@ module Droonga
     def process(request)
       table = @context[request["table"]]
       return [false] unless table
-      if table.class == Groonga::Array
-        table.add(request["values"])
-      else
+      if table.support_key?
         table.add(request["key"], request["values"])
+      else
+        table.add(request["values"])
       end
       [true]
     end
-------------- next part --------------
HTML����������������������������...
Download 



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