ruby-changes:59370
From: Nobuyoshi <ko1@a...>
Date: Sun, 22 Dec 2019 15:19:31 +0900 (JST)
Subject: [ruby-changes:59370] d76c8cfecd (master): RDoc of Warning.[] and .[]= [Feature #16345] [ci skip]
https://git.ruby-lang.org/ruby.git/commit/?id=d76c8cfecd From d76c8cfecdaa2960153b5b24ccd0d61f9af60abd Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada <nobu@r...> Date: Sun, 22 Dec 2019 15:18:22 +0900 Subject: RDoc of Warning.[] and .[]= [Feature #16345] [ci skip] diff --git a/error.c b/error.c index a70d021..6c22211 100644 --- a/error.c +++ b/error.c @@ -166,6 +166,23 @@ rb_warning_category_enabled_p(rb_warning_category_t category) https://github.com/ruby/ruby/blob/trunk/error.c#L166 return !(warning_disabled_categories & (1U << category)); } +/* + * call-seq + * Warning[category] -> true or false + * + * Returns the flag to show the warning messages for +category+. + * Supported categories are: + * + * +:deprecated+ :: deprecation warnings + * * assignemnt of non-nil value to <code>$,</code> and <code>$;</code> + * * keyword arguments + * * proc/lambda without block + * etc. + * + * +:experimental+ :: experimental features + * * Pattern matching + */ + static VALUE rb_warning_s_aref(VALUE mod, VALUE category) { @@ -175,6 +192,14 @@ rb_warning_s_aref(VALUE mod, VALUE category) https://github.com/ruby/ruby/blob/trunk/error.c#L192 return Qfalse; } +/* + * call-seq + * Warning[category] = flag -> flag + * + * Sets the warning flags for +category+. + * See Warning.[] for the categories. + */ + static VALUE rb_warning_s_aset(VALUE mod, VALUE category, VALUE flag) { -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/