summaryrefslogtreecommitdiff
path: root/ext/openssl
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-10-23 14:05:07 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-10-23 14:05:07 +0000
commit30d23ec9035ae62d11a7ffe632297206b0d74da5 (patch)
tree67ba57fca1504e79f0f56765985a589a0c28d1b5 /ext/openssl
parent8bbdbf9e75ecdfbc8bfaac4c5c2637332c0aa0bf (diff)
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
Diffstat (limited to 'ext/openssl')
-rw-r--r--ext/openssl/lib/openssl/buffering.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/ext/openssl/lib/openssl/buffering.rb b/ext/openssl/lib/openssl/buffering.rb
index 8b5dd9d..f328c00 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