class_variable_defined?(p1)
public
Show source
/*
* call-seq:
* obj.class_variable_defined?(symbol) => true or false
*
* Returns <code>true</code> if the given class variable is defined
* in <i>obj</i>.
*
* class Fred
* @@foo = 99
* end
* Fred.class_variable_defined?(:@@foo) #=> true
* Fred.class_variable_defined?(:@@bar) #=> false
*/
static VALUE
rb_mod_cvar_defined(obj, iv)
VALUE obj, iv;
{
ID id = rb_to_id(iv);
if (!rb_is_class_id(id)) {
rb_name_error(id, "`%s' is not allowed as a class variable name", rb_id2name(id));
}
return rb_cvar_defined(obj, id);
}