Gestionnaire de fichiers - Editer - /opt/cpanel/ea-ruby24/root/usr/share/ri/system/BasicObject/method_missing-i.ri
Arrière
U:RDoc::AnyMethod[iI"method_missing:ETI"BasicObject#method_missing;TF:privateo:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"IInvoked by Ruby when <i>obj</i> is sent a message it cannot handle. ;TI"H<i>symbol</i> is the symbol for the method called, and <i>args</i> ;TI"Kare any arguments that were passed to it. By default, the interpreter ;TI"Iraises an error when this method is called. However, it is possible ;TI">to override the method to provide more dynamic behavior. ;TI"KIf it is decided that a particular method should not be handled, then ;TI"F<i>super</i> should be called, so that ancestors can pick up the ;TI"missing method. ;TI"The example below creates ;TI"Fa class <code>Roman</code>, which responds to methods with names ;TI"Gconsisting of roman numerals, returning the corresponding integer ;TI"values.;To:RDoc::Markup::BlankLine o:RDoc::Markup::Verbatim; [I"class Roman ;TI" def roman_to_int(str) ;TI" # ... ;TI" end ;TI"" def method_missing(methId) ;TI" str = methId.id2name ;TI" roman_to_int(str) ;TI" end ;TI" end ;TI" ;TI"r = Roman.new ;TI"r.iv #=> 4 ;TI"r.xxiii #=> 23 ;TI"r.mm #=> 2000;T:@format0: @fileI"vm_eval.c;T:0@omit_headings_from_table_of_contents_below0I"7obj.method_missing(symbol [, *args] ) -> result ;T0[ I"(*args);T@*FI"BasicObject;TcRDoc::NormalClass00
| ver. 1.4 |
Github
|
.
| PHP 8.0.30 | Génération de la page: 0.03 |
proxy
|
phpinfo
|
Réglages