# \[Documentation Bug\] Method Missing

**URL:** <https://rubytalk.org/t/documentation-bug-method-missing/14915>\
**Category:** ruby-talk\
**Created:** [22 November 2004 19:32 UTC](https://rubytalk.org/t/documentation-bug-method-missing/14915 "2004-11-22T19:32:20Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Brian\_SchrA\_der](https://avatars.discourse-cdn.com/v4/letter/b/c67d28/32.png) [@Brian\_SchrA\_der](https://rubytalk.org/u/Brian_SchrA_der)\
**Post date:** [22 November 2004 19:32 UTC](https://rubytalk.org/t/documentation-bug-method-missing/14915/1 "2004-11-22T19:32:20Z")

</div>

Just a minor typo in the documentation

-------------------------------------------------- Kernel#method\_missing  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;obj.method\_missing(symbol [, \*args] ) =\> result

> **···**
>
> ------------------------------------------------------------------------  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Invoked by Ruby when obj is sent a message it cannot handle.  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;symbol is the symbol for the method called, and args are any  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;arguments that were passed to it. By default, the interpreter  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;raises an error when this method is called. However, it is  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;possible to override the method to provide more dynamic behavior.  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The example below creates a class Roman, which responds to methods  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;with names consisting of roman numerals, returning the  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;corresponding integer values.
> 
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;class Roman  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;def romanToInt(str)  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# ...  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;def method\_missing(methId)  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;str = methId.id2name  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;romanToInt(str)  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;r = Roman.new  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;r.iv #=\> 4  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;r.xxiii #=\> 23  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[r.mm](http://r.mm) #=\> 2000
> 
> I think that it would make sense to gsub(/methId/, 'meth\_id') to go with standard ruby dialect.
> 
> Regards,
> 
> Brian
> 
> --  
> Brian Schröder  
> [http://www.brian-schroeder.de/](http://www.brian-schroeder.de/)

---

<div class="post-metadata">

**Author:** ![Brian\_SchrA\_der](https://avatars.discourse-cdn.com/v4/letter/b/c67d28/32.png) [@Brian\_SchrA\_der](https://rubytalk.org/u/Brian_SchrA_der)\
**Post date:** [22 November 2004 21:01 UTC](https://rubytalk.org/t/documentation-bug-method-missing/14915/2 "2004-11-22T21:01:56Z")

</div>

Another Thing I noticed. (I checked against the documentation at ruby-doc org. I hope that is the newest version.)

--------------------------------------------------------- Object#methods  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;obj.methods =\> array

> **···**
>
> ------------------------------------------------------------------------  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns a list of the names of methods publicly accessible in obj.  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;This will include all the methods accessible in obj's ancestors.
> 
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;class Klass  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;def kMethod()  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;k = Klass.new  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;k.methods[0..9] #=\> ["kMethod", "freeze", "nil?", "is\_a?",  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"class", "instance\_variable\_set",  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"methods", "extend", "\<em\>send\</em\>", "instance\_eval"]  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;k.methods.length #=\> 42  
>   
> $ ruby -v  
> ruby 1.8.2 (2004-11-03) [i386-linux]
> 
> $ irb --prompt-mode xmp  
> class Klass  
> &nbsp;&nbsp;def kMethod()  
> &nbsp;&nbsp;end  
> end  
> ==\>nil  
> k = Klass.new  
> ==\>#\<Klass:0x402c00a4\>  
> k.methods[0..9]  
> ==\>["clone", "protected\_methods", "kMethod", "freeze", "instance\_variable\_set", "is\_a?", "type", "methods", "method", "=~"]  
> k.methods.length  
> ==\>41  
>   
> And additionally, here is again the snake\_case against CamelCase issue.
> 
> Regards,
> 
> Brian
> 
> --  
> Brian Schröder  
> [http://ruby.brian-schroeder.de/](http://ruby.brian-schroeder.de/)

---

<div class="post-metadata">

**Author:** ![Dave\_Thomas2](https://avatars.discourse-cdn.com/v4/letter/d/a183cd/32.png) [@Dave\_Thomas2](https://rubytalk.org/u/Dave_Thomas2)\
**Post date:** [22 November 2004 21:13 UTC](https://rubytalk.org/t/documentation-bug-method-missing/14915/3 "2004-11-22T21:13:54Z")

</div>

The documentation is correct, but the list of methods in Object has changed.

As a matter of interest, are the ruby-doc folks now maintaining the documentation?

Cheers

Dave

> **···**
>
> On Nov 22, 2004, at 15:01, Brian Schröder wrote:
> 
> > Another Thing I noticed. (I checked against the documentation at ruby-doc org. I hope that is the newest version.)  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;k.methods[0..9] #=\> ["kMethod", "freeze", "nil?", "is\_a?",  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"class", "instance\_variable\_set",  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"methods", "extend", "\<em\>send\</em\>", "instance\_eval"]  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;k.methods.length #=\> 42
> > 
> > k.methods[0..9]  
> > ==\>["clone", "protected\_methods", "kMethod", "freeze", "instance\_variable\_set", "is\_a?", "type", "methods", "method", "=~"]  
> > k.methods.length  
> > ==\>41

---

<div class="post-metadata">

**Author:** ![Gavin\_Sinclair](https://avatars.discourse-cdn.com/v4/letter/g/db5fbb/32.png) [@Gavin\_Sinclair](https://rubytalk.org/u/Gavin_Sinclair)\
**Post date:** [24 November 2004 05:43 UTC](https://rubytalk.org/t/documentation-bug-method-missing/14915/4 "2004-11-24T05:43:10Z")

</div>

No. When I get my CVS account back [1], the answer will be yes.

Gavin

[1] i.e. when I work out how to use GPG and SSH correctly.

> **···**
>
> On Tuesday, November 23, 2004, 8:13:54 AM, Dave wrote:
> 
> > As a matter of interest, are the ruby-doc folks now maintaining the  
> > documentation?

---

<div class="post-metadata">

**Author:** ![Brian\_SchrA\_der](https://avatars.discourse-cdn.com/v4/letter/b/c67d28/32.png) [@Brian\_SchrA\_der](https://rubytalk.org/u/Brian_SchrA_der)\
**Post date:** [24 November 2004 08:33 UTC](https://rubytalk.org/t/documentation-bug-method-missing/14915/5 "2004-11-24T08:33:51Z")

</div>

And regarding the two snake\_case vs camelCase issues is this going to be changed?

Regards,

Brian

> **···**
>
> On Tue, 23 Nov 2004 06:13:54 +0900 Dave Thomas \<pragdave@gmail.com\> wrote:
> 
> > On Nov 22, 2004, at 15:01, Brian Schröder wrote:
> > 
> > \> Another Thing I noticed. (I checked against the documentation at  
> > \> ruby-doc org. I hope that is the newest version.)  
> > \> k.methods[0..9] #=\> ["kMethod", "freeze", "nil?", "is\_a?",  
> > \> "class", "instance\_variable\_set",  
> > \> "methods", "extend", "\<em\>send\</em\>",  
> > \> "instance\_eval"]  
> > \> k.methods.length #=\> 42  
> > \>
> > 
> > \> k.methods[0..9]  
> > \> ==\>["clone", "protected\_methods", "kMethod", "freeze",  
> > \> "instance\_variable\_set", "is\_a?", "type", "methods", "method", "=~"]  
> > \> k.methods.length  
> > \> ==\>41  
> > \>
> > 
> > The documentation is correct, but the list of methods in Object has  
> > changed.
> > 
> > As a matter of interest, are the ruby-doc folks now maintaining the  
> > documentation?
> > 
> > Cheers
> > 
> > Dave
> 
> --  
> Brian Schröder  
> [http://www.brian-schroeder.de/](http://www.brian-schroeder.de/)
