[前][次][番号順一覧][スレッド一覧]

ruby-changes:63882

From: Jeremy <ko1@a...>
Date: Fri, 4 Dec 2020 06:08:08 +0900 (JST)
Subject: [ruby-changes:63882] 9195310168 (master): Update documentation for String#encode{, !} [ci skip]

https://git.ruby-lang.org/ruby.git/commit/?id=9195310168

From 9195310168fa43186b1918fb0432a54b000fcbba Mon Sep 17 00:00:00 2001
From: Jeremy Evans <code@j...>
Date: Thu, 3 Dec 2020 12:47:34 -0800
Subject: Update documentation for String#encode{,!} [ci skip]

These methods take keywords, not a hash.

From tjschuck (T.J. Schuck)

Fixes [Bug #17364]

diff --git a/transcode.c b/transcode.c
index 3a37c63..5bae646 100644
--- a/transcode.c
+++ b/transcode.c
@@ -2784,14 +2784,14 @@ str_encode_associate(VALUE str, int encidx) https://github.com/ruby/ruby/blob/trunk/transcode.c#L2784
 
 /*
  *  call-seq:
- *     str.encode!(encoding [, options] )   -> str
- *     str.encode!(dst_encoding, src_encoding [, options] )   -> str
+ *     str.encode!(encoding, **options)   -> str
+ *     str.encode!(dst_encoding, src_encoding, **options)   -> str
  *
  *  The first form transcodes the contents of <i>str</i> from
  *  str.encoding to +encoding+.
  *  The second form transcodes the contents of <i>str</i> from
  *  src_encoding to dst_encoding.
- *  The options Hash gives details for conversion. See String#encode
+ *  The +options+ keyword arguments give details for conversion. See String#encode
  *  for details.
  *  Returns the string even if no changes were made.
  */
@@ -2820,9 +2820,9 @@ static VALUE encoded_dup(VALUE newstr, VALUE str, int encidx); https://github.com/ruby/ruby/blob/trunk/transcode.c#L2820
 
 /*
  *  call-seq:
- *     str.encode(encoding [, options] )   -> str
- *     str.encode(dst_encoding, src_encoding [, options] )   -> str
- *     str.encode([options])   -> str
+ *     str.encode(encoding, **options)   -> str
+ *     str.encode(dst_encoding, src_encoding, **options)   -> str
+ *     str.encode(**options)   -> str
  *
  *  The first form returns a copy of +str+ transcoded
  *  to encoding +encoding+.
@@ -2838,8 +2838,8 @@ static VALUE encoded_dup(VALUE newstr, VALUE str, int encidx); https://github.com/ruby/ruby/blob/trunk/transcode.c#L2838
  *  in the source encoding. The last form by default does not raise
  *  exceptions but uses replacement strings.
  *
- *  The +options+ Hash gives details for conversion and can have the following
- *  keys:
+ *  The +options+ keyword arguments give details for conversion.
+ *  The arguments are:
  *
  *  :invalid ::
  *    If the value is +:replace+, #encode replaces invalid byte sequences in
-- 
cgit v0.10.2


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]