summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authornagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-01-16 19:21:32 +0000
committernagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-01-16 19:21:32 +0000
commitbc059aa6d5a5987628b19108b5448915ae3012af (patch)
tree708aa216286a914b093b016cb67a21f069d6803b /doc
parente9ab3c7ccae115d623339f0382289d66a8621ec9 (diff)
merge revision(s) 56980,56981: [Backport #13004]
extension.rdoc: fix rb_get_kwargs [ci skip] * doc/extension.rdoc: [DOC] optional keyword arguments are defaulted to Qundef. ignored keys are kept in the hash but a new Hash is not created. [ruby-dev:49893] [Bug #13004] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@57346 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'doc')
-rw-r--r--doc/extension.ja.rdoc8
-rw-r--r--doc/extension.rdoc7
2 files changed, 7 insertions, 8 deletions
diff --git a/doc/extension.ja.rdoc b/doc/extension.ja.rdoc
index b6b8623cda..7a9729eb41 100644
--- a/doc/extension.ja.rdoc
+++ b/doc/extension.ja.rdoc
@@ -1397,10 +1397,10 @@ int rb_get_kwargs(VALUE keyword_hash, const ID *table, int required, int optiona
optional (optionalが負の場合は-optional-1) 個のIDは省略可能
キーワードです.必須キーワードがkeyword_hash中にない場合,
"missing keyword"ArgumentErrorが発生します.省略可能キーワー
- ドがない場合は,values中の対応する要素は変更されません.
- keyword_hashに使用されない要素がある場合は,optionalが負なら
- 新しいHashとして省略可能引数の次に保存されますが,そうでなけ
- れば"unknown keyword"ArgumentErrorが発生します.
+ ドがない場合は,values中の対応する要素にはQundefがセットされ
+ ます.keyword_hashに使用されない要素がある場合は,optionalが
+ 負なら無視されますが,そうでなければ"unknown keyword"
+ ArgumentErrorが発生します.
VALUE rb_extract_keywords(VALUE *original_hash) ::
diff --git a/doc/extension.rdoc b/doc/extension.rdoc
index 69d9f2561b..40f83bf0d8 100644
--- a/doc/extension.rdoc
+++ b/doc/extension.rdoc
@@ -1410,10 +1410,9 @@ int rb_get_kwargs(VALUE keyword_hash, const ID *table, int required, int optiona
+optional+ is negative) number of IDs are optional. If a
mandatory key is not contained in +keyword_hash+, raises "missing
keyword" +ArgumentError+. If an optional key is not present in
- +keyword_hash+, the corresponding element in +values+ is not changed.
- If +optional+ is negative, rest of +keyword_hash+ are stored in the
- next to optional +values+ as a new Hash, otherwise raises "unknown
- keyword" +ArgumentError+.
+ +keyword_hash+, the corresponding element in +values+ is set to +Qundef+.
+ If +optional+ is negative, rest of +keyword_hash+ are ignored, otherwise
+ raises "unknown keyword" +ArgumentError+.
Be warned, handling keyword arguments in the C API is less efficient
than handling them in Ruby. Consider using a Ruby wrapper method