summaryrefslogtreecommitdiff
path: root/class.c
diff options
context:
space:
mode:
authorzzak <zzak@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-05-25 00:43:14 +0000
committerzzak <zzak@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-05-25 00:43:14 +0000
commit10e7f389e26f3903e89d8d67aa5d8522c7da460a (patch)
tree4dafae6b8436126e2be5b176a03acfaff9d09d78 /class.c
parent0be4ec01cd5f9d517afd86f1c5f7a9922e6dfae3 (diff)
* class.c: [DOC] Fixed grammar and examples of instance_methods.
By @alex-frost via documenting-ruby/ruby#31 [ci skip] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46090 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'class.c')
-rw-r--r--class.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/class.c b/class.c
index 02a9e62..be59e68 100644
--- a/class.c
+++ b/class.c
@@ -1181,25 +1181,25 @@ class_instance_method_list(int argc, VALUE *argv, VALUE mod, int obj, int (*func
*
* Returns an array containing the names of the public and protected instance
* methods in the receiver. For a module, these are the public and protected methods;
- * for a class, they are the instance (not singleton) methods. With no
- * argument, or with an argument that is <code>false</code>, the
- * instance methods in <i>mod</i> are returned, otherwise the methods
- * in <i>mod</i> and <i>mod</i>'s superclasses are returned.
+ * for a class, they are the instance (not singleton) methods. If the optional
+ * parameter is <code>false</code>, the methods of any ancestors are not included.
*
* module A
* def method1() end
* end
* class B
+ * include A
* def method2() end
* end
* class C < B
* def method3() end
* end
*
- * A.instance_methods #=> [:method1]
- * B.instance_methods(false) #=> [:method2]
- * C.instance_methods(false) #=> [:method3]
- * C.instance_methods(true).length #=> 43
+ * A.instance_methods(false) #=> [:method1]
+ * B.instance_methods(false) #=> [:method2]
+ * B.instance_methods(true).include?(:method1) #=> true
+ * C.instance_methods(false) #=> [:method3]
+ * C.instance_methods.include?(:method2) #=> true
*/
VALUE
@@ -1213,8 +1213,8 @@ rb_class_instance_methods(int argc, VALUE *argv, VALUE mod)
* 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
- * methods of any ancestors are included.
+ * <i>mod</i>. If the optional parameter is <code>false</code>, the
+ * methods of any ancestors are not included.
*/
VALUE
@@ -1228,8 +1228,8 @@ rb_class_protected_instance_methods(int argc, VALUE *argv, VALUE mod)
* 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
- * methods of any ancestors are included.
+ * <i>mod</i>. If the optional parameter is <code>false</code>, the
+ * methods of any ancestors are not included.
*
* module Mod
* def method1() end
@@ -1251,8 +1251,8 @@ rb_class_private_instance_methods(int argc, VALUE *argv, VALUE mod)
* 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
- * any ancestors are included.
+ * If the optional parameter is <code>false</code>, the methods of
+ * any ancestors are not included.
*/
VALUE
@@ -1268,8 +1268,8 @@ rb_class_public_instance_methods(int argc, VALUE *argv, VALUE mod)
* Returns a list of the names of public and protected methods of
* <i>obj</i>. This will include all the methods accessible in
* <i>obj</i>'s ancestors.
- * If the <i>regular</i> parameter is set to <code>false</code>,
- * Returns an array of obj's public and protected singleton methods,
+ * If the optional parameter is <code>false</code>, it
+ * returns an array of <i>obj<i>'s public and protected singleton methods,
* the array will not include methods in modules included in <i>obj</i>.
*
* class Klass
@@ -1280,7 +1280,7 @@ rb_class_public_instance_methods(int argc, VALUE *argv, VALUE mod)
* k.methods[0..9] #=> [:klass_method, :nil?, :===,
* # :==~, :!, :eql?
* # :hash, :<=>, :class, :singleton_class]
- * k.methods.length #=> 57
+ * k.methods.length #=> 56
*
* k.methods(false) #=> []
* def k.singleton_method; end