Repository URL to install this package:
|
Version:
2.2.2-1 ▾
|
U:RDoc::AnyMethod[iI"const_defined?:ETI"Module#const_defined?;TF:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"MSays whether _mod_ or its ancestors have a constant with the given name:;To:RDoc::Markup::BlankLine o:RDoc::Markup::Verbatim; [I"IFloat.const_defined?(:EPSILON) #=> true, found in Float itself
;TI"NFloat.const_defined?("String") #=> true, found in Object (ancestor)
;TI"3BasicObject.const_defined?(:Hash) #=> false
;T:@format0o;
; [I"QIf _mod_ is a +Module+, additionally +Object+ and its ancestors are checked:;T@o;; [I">Math.const_defined?(:String) #=> true, found in Object
;T;
0o;
; [I"OIn each of the checked classes or modules, if the constant is not present ;TI"Jbut there is an autoload for it, +true+ is returned directly without ;TI"autoloading:;T@o;; [ I"module Admin
;TI"$ autoload :User, 'admin/user'
;TI" end
;TI",Admin.const_defined?(:User) #=> true
;T;
0o;
; [I"OIf the constant is not found the callback +const_missing+ is *not* called ;TI"$and the method returns +false+.;T@o;
; [I"QIf +inherit+ is false, the lookup only checks the constants in the receiver:;T@o;; [I"UIO.const_defined?(:SYNC) #=> true, found in File::Constants (ancestor)
;TI"IIO.const_defined?(:SYNC, false) #=> false, not found in IO itself
;T;
0o;
; [I":In this case, the same logic for autoloading applies.;T@o;
; [I"SIf the argument is not a valid constant name a +NameError+ is raised with the ;TI"*message "wrong constant name _name_":;T@o;; [I"MHash.const_defined? 'foobar' #=> NameError: wrong constant name foobar;T;
0:
@fileI"
object.c;T:0@omit_headings_from_table_of_contents_below0I"wmod.const_defined?(sym, inherit=true) -> true or false
mod.const_defined?(str, inherit=true) -> true or false
;T0[ I"(*args);T@:FI"Module;TcRDoc::NormalClass00