| Server IP : 162.214.74.102 / Your IP : 216.73.217.21 Web Server : Apache System : Linux dedi-4363141.lrsys.com.br 3.10.0-1160.119.1.el7.tuxcare.els25.x86_64 #1 SMP Wed Oct 1 17:37:27 UTC 2025 x86_64 User : lrsys ( 1015) PHP Version : 5.6.40 Disable Function : exec,passthru,shell_exec,system MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /proc/self/root/opt/cpanel/ea-ruby24/root/usr/share/ri/system/Module/ |
Upload File : |
U:RDoc::AnyMethod[iI"const_missing:ETI"Module#const_missing;TF:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [ I"BInvoked when a reference is made to an undefined constant in ;FI"G<i>mod</i>. It is passed a symbol for the undefined constant, and ;FI"7returns a value to be used for that constant. The ;FI".following code is an example of the same:;Fo:RDoc::Markup::BlankLine o:RDoc::Markup::Verbatim; [
I"!def Foo.const_missing(name)
;TI"1 name # return the constant name as Symbol
;TI" end
;TI"
;TI"CFoo::UNDEFINED_CONST #=> :UNDEFINED_CONST: symbol returned
;T:@format0o;
; [I"LIn the next example when a reference is made to an undefined constant, ;FI"Kit attempts to load a file whose name is the lowercase version of the ;FI"Econstant (thus class <code>Fred</code> is assumed to be in file ;FI"G<code>fred.rb</code>). If found, it returns the loaded class. It ;FI"Mtherefore implements an autoload feature similar to Kernel#autoload and ;FI"Module#autoload.;F@o;; [I"$def Object.const_missing(name)
;TI" @looked_for ||= {}
;TI" str_name = name.to_s
;TI"A raise "Class not found: #{name}" if @looked_for[str_name]
;TI"! @looked_for[str_name] = 1
;TI" file = str_name.downcase
;TI" require file
;TI" klass = const_get(name)
;TI" return klass if klass
;TI"( raise "Class not found: #{name}"
;TI"end;T;
0:
@fileI"
object.c;T:0@omit_headings_from_table_of_contents_below0I"&mod.const_missing(sym) -> obj
;F0[ I" (p1);T@.FI"Module;TcRDoc::NormalClass00