Bug #5880 ยป 0001-object.c-rb_obj_is_instance_of-rb_obj_is_kind_of-add.patch
object.c | ||
---|---|---|
*
|
||
* Returns <code>true</code> if <i>obj</i> is an instance of the given
|
||
* class. See also <code>Object#kind_of?</code>.
|
||
*
|
||
* class A; end
|
||
* class B < A; end
|
||
* class C < B; end
|
||
*
|
||
* b = B.new
|
||
* b.instance_of? A #=> false
|
||
* b.instance_of? B #=> true
|
||
* b.instance_of? C #=> false
|
||
*/
|
||
VALUE
|
||
... | ... | |
* end
|
||
* class B < A; end
|
||
* class C < B; end
|
||
*
|
||
* b = B.new
|
||
* b.instance_of? A #=> false
|
||
* b.instance_of? B #=> true
|
||
* b.instance_of? C #=> false
|
||
* b.instance_of? M #=> false
|
||
* b.is_a? A #=> true
|
||
* b.is_a? B #=> true
|
||
* b.is_a? C #=> false
|
||
* b.is_a? M #=> true
|
||
*
|
||
* b.kind_of? A #=> true
|
||
* b.kind_of? B #=> true
|
||
* b.kind_of? C #=> false
|