APIdock / Ruby
/
method

private_method_defined?

ruby latest stable - Class: Module
private_method_defined?(p1)
public

Returns true if the named private method is defined by _ mod_ (or its included modules and, if mod is a class, its ancestors). String arguments are converted to symbols.

module A
 def method1() end
end
class B
 private 
 def method2() end
end
class C < B
 include  A
 def method3() end
end
A.method_defined?  :method1 #=> true
C.private_method_defined?  "method1" #=> false
C.private_method_defined?  "method2" #=> true
C.method_defined?  "method2" #=> false
static VALUE
rb_mod_private_method_defined(VALUE mod, VALUE mid)
{
 return check_definition(mod, mid, METHOD_VISI_PRIVATE);
}

AltStyle によって変換されたページ (->オリジナル) /