* 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
This commit is contained in:
parent
0be4ec01cd
commit
10e7f389e2
@ -1,3 +1,8 @@
|
||||
Sun May 25 09:41:56 2014 Zachary Scott <e@zzak.io>
|
||||
|
||||
* class.c: [DOC] Fixed grammar and examples of instance_methods.
|
||||
By @alex-frost via documenting-ruby/ruby#31
|
||||
|
||||
Sun May 25 09:40:44 2014 Tanaka Akira <akr@fsij.org>
|
||||
|
||||
* test/lib/minitest/unit.rb: Show leakes threads and tempfiles.
|
||||
|
30
class.c
30
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]
|
||||
* 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(true).length #=> 43
|
||||
* 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
|
||||
|
Loading…
x
Reference in New Issue
Block a user