[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Undocumented argument on Object#methods

Stefan Rusterholz

7/13/2007 10:21:00 AM

Due to a discussion in irc.freenode.org#ruby I stumbled over an
undocumented argument to Object#method. My suggested fix to the
documentation is below, or was it left out intentionally?

Regards
Stefan

in object.c:
/*
* call-seq:
* obj.methods(singleton=true) => array
*
* Returns a list of the names of methods publicly accessible in
* <i>obj</i>. This will include all the methods accessible in
* <i>obj</i>'s ancestors.
* If singleton is set to false, it will return an array of
<i>obj</i>'s
* singleton methods.
*
* class Klass
* def kMethod()
* end
* end
* k = Klass.new
* k.methods[0..9] #=> ["kMethod", "freeze", "nil?", "is_a?",
* "class", "instance_variable_set",
* "methods", "extend", "__send__",
"instance_eval"]
* k.methods.length #=> 42
* def k.kSingletonMethod; end
* k.methods(false) # => ["kSingletonMethod"]
*/

--
Posted via http://www.ruby-....

4 Answers

Jano Svitok

7/13/2007 10:40:00 AM

0

On 7/13/07, Stefan Rusterholz <apeiros@gmx.net> wrote:
> Due to a discussion in irc.freenode.org#ruby I stumbled over an
> undocumented argument to Object#method. My suggested fix to the
> documentation is below, or was it left out intentionally?
>
> Regards
> Stefan
>
> in object.c:
> /*
> * call-seq:
> * obj.methods(singleton=true) => array
> *
> * Returns a list of the names of methods publicly accessible in
> * <i>obj</i>. This will include all the methods accessible in
> * <i>obj</i>'s ancestors.
> * If singleton is set to false, it will return an array of
> <i>obj</i>'s
> * singleton methods.
> *
> * class Klass
> * def kMethod()
> * end
> * end
> * k = Klass.new
> * k.methods[0..9] #=> ["kMethod", "freeze", "nil?", "is_a?",
> * "class", "instance_variable_set",
> * "methods", "extend", "__send__",
> "instance_eval"]
> * k.methods.length #=> 42
> * def k.kSingletonMethod; end
> * k.methods(false) # => ["kSingletonMethod"]
> */

Can you please create a patch according to
http://www.ruby-lang.org/en/community/...

and file it to ruby patch tracker:
http://rubyforge.org/tracker/?atid=1700&group_id=426&f...

Thanks.

Jano

James Britt

7/13/2007 2:42:00 PM

0

Jano Svitok wrote:

>
> Can you please create a patch according to
> http://www.ruby-lang.org/en/community/...



See also the documentation guidelines at

http://ruby-doc.org/documentation-guide...


--
James Britt

"To predict the behavior of ordinary people in advance, you only have to
assume that they will always try to escape a disagreeable situation with
the smallest possible expenditure of intelligence."
- Friedrich Nietzsche

Stefan Rusterholz

7/13/2007 3:22:00 PM

0

James Britt wrote:
> Jano Svitok wrote:
>
>>
>> Can you please create a patch according to
>> http://www.ruby-lang.org/en/community/...
>
>
>
> See also the documentation guidelines at
>
> http://ruby-doc.org/documentation-guide...

Thanks to both of you. Any way to work around the read-onlyness (I use
ruby-forum.com) of ruby-core without having to register?

Regards
Stefan

--
Posted via http://www.ruby-....

Florian Groß

7/13/2007 3:28:00 PM

0

> Thanks to both of you. Any way to work around the read-onlyness (I use
> ruby-forum.com) of ruby-core without having to register?

You can use http://groups.google.com/group/ruby-co... for
reading it more comfortably. I think you will still need to subscribe
to the ML though for posting. (But you can turn off receiving
messages / automatically move them to the trash.)