File: //usr/share/ri/3.0.0/system/Warning/cdesc-Warning.ri
U:RDoc::NormalModule[iI"Warning:ET@0o:RDoc::Markup::Document:@parts[o;;[o:RDoc::Markup::Paragraph;[ I"FThe Warning module contains a single method named #warn, and the ;TI";module extends itself, making Warning.warn available. ;TI"=Warning.warn is called for all warnings issued by Ruby. ;TI"1By default, warnings are printed to $stderr.;To:RDoc::Markup::BlankLine o; ;[I"SChanging the behavior of Warning.warn is useful to customize how warnings are ;TI"Qhandled by Ruby, for instance by filtering some warnings, and/or outputting ;TI"+warnings somewhere other than $stderr.;T@o; ;[I"GIf you want to change the behavior of Warning.warn you should use ;TI"I+Warning.extend(MyNewModuleWithWarnMethod)+ and you can use `super` ;TI"Dto get the default behavior of printing the warning to $stderr.;T@o; ;[I"
Example:;To:RDoc::Markup::Verbatim;[I"module MyWarningFilter
;TI"2 def warn(message, category: nil, **kwargs)
;TI"> if /some warning I want to ignore/.matches?(message)
;TI" # ignore
;TI" else
;TI" super
;TI"
end
;TI" end
;TI" end
;TI"$Warning.extend MyWarningFilter
;T:@format0o; ;[I"PYou should never redefine Warning#warn (the instance method), as that will ;TI">then no longer provide a way to use the default behavior.;T@o; ;[I"JThe +warning+ gem provides convenient ways to customize Warning.warn.;T:
@fileI"error.c;T:0@omit_headings_from_table_of_contents_below0;
0;0[ [ [ [[I"
class;T[[:public[[I"[];TI"error.c;T[I"[]=;T@?[:protected[ [:private[ [I"
instance;T[[;[[I" warn;T@?[;[ [;[ [ [U:RDoc::Context::Section[i 0o;;[ ;
0;0[@3@3cRDoc::TopLevel