diff options
author | ocean <ocean@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-07-15 11:42:51 +0000 |
---|---|---|
committer | ocean <ocean@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-07-15 11:42:51 +0000 |
commit | 99a04c1adfef7da4f4d626d744381c99d42e2a77 (patch) | |
tree | 27d9106c6726271f2721036fe9f6b1ab59eb8811 /class.c | |
parent | 61817f40af29cdf56c6bb64182f699c662895231 (diff) |
* class.c, error.c, eval.c, intern.h, object.c, variable.c:
do not set path if it is a singleton class. [ruby-dev:22588]
(backport from 1.9)
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@6635 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'class.c')
-rw-r--r-- | class.c | 24 |
1 files changed, 12 insertions, 12 deletions
@@ -175,7 +175,6 @@ rb_define_class_id(id, super) if (!super) super = rb_cObject; klass = rb_class_new(super); - rb_name_class(klass, id); rb_make_metaclass(klass, RBASIC(super)->klass); return klass; @@ -226,6 +225,7 @@ rb_define_class(name, super) } klass = rb_define_class_id(id, super); st_add_direct(rb_class_tbl, id, klass); + rb_name_class(klass, id); rb_const_set(rb_cObject, id, klass); rb_class_inherited(super, klass); @@ -630,7 +630,7 @@ class_instance_method_list(argc, argv, mod, func) /* * call-seq: - * mod.instance_methods(include_super=false) => array + * mod.instance_methods(include_super=true) => array * * Returns an array containing the names of public instance methods in * the receiver. For a module, these are the public methods; for a @@ -650,8 +650,8 @@ class_instance_method_list(argc, argv, mod, func) * end * * A.instance_methods #=> ["method1"] - * B.instance_methods #=> ["method2"] - * C.instance_methods #=> ["method3"] + * B.instance_methods(false) #=> ["method2"] + * C.instance_methods(false) #=> ["method3"] * C.instance_methods(true).length #=> 43 */ @@ -666,7 +666,7 @@ rb_class_instance_methods(argc, argv, mod) /* * call-seq: - * mod.protected_instance_methods(include_super=false) => array + * mod.protected_instance_methods(include_super=true) => array * * Returns a list of the protected instance methods defined in * <i>mod</i>. If the optional parameter is not <code>false</code>, the @@ -684,7 +684,7 @@ rb_class_protected_instance_methods(argc, argv, mod) /* * call-seq: - * mod.private_instance_methods(include_super=false) => array + * mod.private_instance_methods(include_super=true) => array * * Returns a list of the private instance methods defined in * <i>mod</i>. If the optional parameter is not <code>false</code>, the @@ -710,7 +710,7 @@ rb_class_private_instance_methods(argc, argv, mod) /* * call-seq: - * mod.public_instance_methods(include_super=false) => array + * mod.public_instance_methods(include_super=true) => array * * Returns a list of the public instance methods defined in <i>mod</i>. * If the optional parameter is not <code>false</code>, the methods of @@ -728,7 +728,7 @@ rb_class_public_instance_methods(argc, argv, mod) /* * call-seq: - * obj.singleton_methods(all=false) => array + * obj.singleton_methods(all=true) => array * * Returns an array of the names of singleton methods for <i>obj</i>. * If the optional <i>all</i> parameter is true, the list will include @@ -745,17 +745,17 @@ rb_class_public_instance_methods(argc, argv, mod) * a = Single.new * * def a.one() + * end * * class << a - * end * include Other * def two() + * end * end * - * end * Single.singleton_methods #=> ["four"] - * a.singleton_methods #=> ["two", "one"] - * a.singleton_methods(true) #=> ["two", "one", "three"] + * a.singleton_methods(false) #=> ["two", "one"] + * a.singleton_methods #=> ["two", "one", "three"] */ VALUE |