# Undocumented argument on Object#methods

**URL:** <https://www.ruby-forum.com/t/undocumented-argument-on-object-methods/109318>\
**Category:** Ruby\
**Created:** [July 13, 2007, 12:17pm UTC](https://www.ruby-forum.com/t/undocumented-argument-on-object-methods/109318 "2007-07-13T12:17:51Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![apeiros](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/838e76/32.png) [@apeiros](https://www.ruby-forum.com/u/apeiros)\
**Post date:** [July 13, 2007, 12:17pm UTC](https://www.ruby-forum.com/t/undocumented-argument-on-object-methods/109318/1 "2007-07-13T12:17:51Z")

</div>

Due to a discussion in [irc.freenode.org#ruby](http://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
- _obj_. This will include all the methods accessible in
- _obj_'s ancestors.
- If singleton is set to false, it will return an array of  
_obj_'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"]

```

\*/

---

<div class="post-metadata">

**Author:** ![apeiros](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/838e76/32.png) [@apeiros](https://www.ruby-forum.com/u/apeiros)\
**Post date:** [July 13, 2007, 12:41pm UTC](https://www.ruby-forum.com/t/undocumented-argument-on-object-methods/109318/2 "2007-07-13T12:41:07Z")

</div>

On 7/13/07, Stefan R. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> - 
> 
> ```
> obj.methods(singleton=true) => array
> 
> ```
> 
> - 
> 
> ```
> 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/ruby-core/](http://www.ruby-lang.org/en/community/ruby-core/)

and file it to ruby patch tracker:  
[http://rubyforge.org/tracker/?atid=1700&group\_id=426&func=browse](http://rubyforge.org/tracker/?atid=1700&group_id=426&func=browse)

Thanks.

Jano

---

<div class="post-metadata">

**Author:** ![apeiros](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/838e76/32.png) [@apeiros](https://www.ruby-forum.com/u/apeiros)\
**Post date:** [July 13, 2007, 4:43pm UTC](https://www.ruby-forum.com/t/undocumented-argument-on-object-methods/109318/3 "2007-07-13T16:43:48Z")

</div>

Jano S. wrote:

> Can you please create a patch according to  
> [Ruby Core](http://www.ruby-lang.org/en/community/ruby-core/)

See also the documentation guidelines at

[http://ruby-doc.org/documentation-guidelines.html](http://ruby-doc.org/documentation-guidelines.html)

–  
James B.

“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

---

<div class="post-metadata">

**Author:** ![apeiros](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/838e76/32.png) [@apeiros](https://www.ruby-forum.com/u/apeiros)\
**Post date:** [July 13, 2007, 5:21pm UTC](https://www.ruby-forum.com/t/undocumented-argument-on-object-methods/109318/4 "2007-07-13T17:21:04Z")

</div>

James B. wrote:

> Jano S. wrote:
> 
> > Can you please create a patch according to  
> > [Ruby Core](http://www.ruby-lang.org/en/community/ruby-core/)
> 
> See also the documentation guidelines at
> 
> [Ruby Documentation Submission Guidelines](http://ruby-doc.org/documentation-guidelines.html)

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

Regards  
Stefan

---

<div class="post-metadata">

**Author:** ![apeiros](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/838e76/32.png) [@apeiros](https://www.ruby-forum.com/u/apeiros)\
**Post date:** [July 13, 2007, 7:24pm UTC](https://www.ruby-forum.com/t/undocumented-argument-on-object-methods/109318/5 "2007-07-13T19:24:15Z")

</div>

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

You can use [http://groups.google.com/group/ruby-core-google/](http://groups.google.com/group/ruby-core-google/) 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.)
