[Groonga-commit] droonga/droonga-client-ruby at b951ea5 [master] Accept message loaded from JSON with :symbolize_names => true

Back to archive index

YUKI Hiroshi null+****@clear*****
Mon Jan 20 12:34:39 JST 2014


YUKI Hiroshi	2014-01-20 12:34:39 +0900 (Mon, 20 Jan 2014)

  New Revision: b951ea59b1ad87e8c5d4585cd6770b729e6ccfec
  https://github.com/droonga/droonga-client-ruby/commit/b951ea59b1ad87e8c5d4585cd6770b729e6ccfec

  Message:
    Accept message loaded from JSON with :symbolize_names => true

  Modified files:
    lib/droonga/client/connection/http.rb

  Modified: lib/droonga/client/connection/http.rb (+3 -3)
===================================================================
--- lib/droonga/client/connection/http.rb    2014-01-20 12:32:32 +0900 (da78efe)
+++ lib/droonga/client/connection/http.rb    2014-01-20 12:34:39 +0900 (dd276f3)
@@ -125,7 +125,7 @@ module Droonga
           http.open_timeout = open_timeout
           http.read_timeout = read_timeout
           http.start do
-            path = message["path"] || build_path(message)
+            path = message["path"] || message[:path] || build_path(message)
             # we should support not only GET but POST also...
             get = Net::HTTP::Get.new(path, build_headers(message))
             http.request(get) do |response|
@@ -142,8 +142,8 @@ module Droonga
 
         private
         def build_path(message)
-          type = message["type"]
-          body = message["body"] || {}
+          type = message["type"] || message[:type]
+          body = message["body"] || message[:body] || {}
           base_path = "/#{type}"
           if body.empty?
             base_path
-------------- next part --------------
HTML����������������������������...
Download 



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