mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Update example to handle keywords passed to Warning.warn
This commit is contained in:
parent
fced98f464
commit
d0778cb264
1 changed files with 2 additions and 2 deletions
4
error.c
4
error.c
|
@ -277,11 +277,11 @@ rb_warning_s_warn(int argc, VALUE *argv, VALUE mod)
|
||||||
*
|
*
|
||||||
* Example:
|
* Example:
|
||||||
* module MyWarningFilter
|
* module MyWarningFilter
|
||||||
* def warn(message)
|
* def warn(message, category: nil, **kwargs)
|
||||||
* if /some warning I want to ignore/.matches?(message)
|
* if /some warning I want to ignore/.matches?(message)
|
||||||
* # ignore
|
* # ignore
|
||||||
* else
|
* else
|
||||||
* super(message)
|
* super
|
||||||
* end
|
* end
|
||||||
* end
|
* end
|
||||||
* end
|
* end
|
||||||
|
|
Loading…
Reference in a new issue