From 30d23ec9035ae62d11a7ffe632297206b0d74da5 Mon Sep 17 00:00:00 2001 From: nobu Date: Mon, 23 Oct 2017 14:05:07 +0000 Subject: multiple arguments to write Make write methods of IO-like objects accept multiple arguments, as well as IO#write. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60383 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/openssl/lib/openssl/buffering.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'ext/openssl/lib') diff --git a/ext/openssl/lib/openssl/buffering.rb b/ext/openssl/lib/openssl/buffering.rb index 8b5dd9da57..f328c0007d 100644 --- a/ext/openssl/lib/openssl/buffering.rb +++ b/ext/openssl/lib/openssl/buffering.rb @@ -339,7 +339,8 @@ module OpenSSL::Buffering # Writes _s_ to the stream. If the argument is not a String it will be # converted using +.to_s+ method. Returns the number of bytes written. - def write(s) + def write(*s) + s = s.size == 1 ? s[0] : s.join("") do_write(s) s.bytesize end -- cgit v1.2.3