qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mcpie...@apache.org
Subject svn commit: r1442337 - /qpid/trunk/qpid/cpp/bindings/qpid/ruby/lib/qpid_messaging/encoding.rb
Date Mon, 04 Feb 2013 20:32:06 GMT
Author: mcpierce
Date: Mon Feb  4 20:32:06 2013
New Revision: 1442337

URL: http://svn.apache.org/viewvc?rev=1442337&view=rev
Log:
QPID-4565: Fixed the encode method for messages.

Modified:
    qpid/trunk/qpid/cpp/bindings/qpid/ruby/lib/qpid_messaging/encoding.rb

Modified: qpid/trunk/qpid/cpp/bindings/qpid/ruby/lib/qpid_messaging/encoding.rb
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/bindings/qpid/ruby/lib/qpid_messaging/encoding.rb?rev=1442337&r1=1442336&r2=1442337&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/bindings/qpid/ruby/lib/qpid_messaging/encoding.rb (original)
+++ qpid/trunk/qpid/cpp/bindings/qpid/ruby/lib/qpid_messaging/encoding.rb Mon Feb  4 20:32:06
2013
@@ -23,19 +23,7 @@ module Qpid
 
     # Encodes the supplied content into the given message.
     def self.encode content, message, encoding = nil
-      prepared = content
-      case content
-      when Hash
-        prepared = {}
-        content.each_pair do |key,value|
-          prepared[key.to_s] = value.to_s
-        end
-        Cqpid::encode prepared, message.message_impl
-      when Array
-        prepared = []
-        content.each {|value| prepared << value.to_s}
-        Cqpid::encode prepared, message.message_impl
-      end
+      Cqpid::encode content, message.message_impl, encoding
     end
 
     # Decodes and returns the message's content.



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


Mime
View raw message