1
0
Fork 0
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:
Benoit Daloze 2020-10-03 13:19:24 +02:00
parent fced98f464
commit d0778cb264

View file

@ -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