# RDoc: Really wrong output (Module#method instead of Module::Class#method)

**URL:** <https://www.ruby-forum.com/t/rdoc-really-wrong-output-module-method-instead-of-module-class-method/172838>\
**Category:** Ruby\
**Created:** [July 28, 2009, 7:31pm UTC](https://www.ruby-forum.com/t/rdoc-really-wrong-output-module-method-instead-of-module-class-method/172838 "2009-07-28T19:31:34Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ISSSSaki\_Baz\_C](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/51bf81/32.png) [@ISSSSaki\_Baz\_C](https://www.ruby-forum.com/u/ISSSSaki_Baz_C)\
**Post date:** [July 28, 2009, 7:31pm UTC](https://www.ruby-forum.com/t/rdoc-really-wrong-output-module-method-instead-of-module-class-method/172838/1 "2009-07-28T19:31:34Z")

</div>

Hi, I’m getting really crazy with RDoc (tested in 1.8 and 1.9).

Basically I’ve a module containing a class containing a method. And  
when I generate the rdoc, the HTML output show the method as a module  
method instead of class. Â¿?Â¿?

However, if I test with a simple file:

* * *

## module MyModule class MyClass def initialize puts “hello” end end end

then the output is correct.

I’ve checked and re-checked my code and is correct. In fact, I use it 🙂  
Is there any known issue about it? Thanks.

---

<div class="post-metadata">

**Author:** ![ISSSSaki\_Baz\_C](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/51bf81/32.png) [@ISSSSaki\_Baz\_C](https://www.ruby-forum.com/u/ISSSSaki_Baz_C)\
**Post date:** [July 28, 2009, 7:37pm UTC](https://www.ruby-forum.com/t/rdoc-really-wrong-output-module-method-instead-of-module-class-method/172838/2 "2009-07-28T19:37:26Z")

</div>

2009/7/28 IÃ±aki Baz C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

> ## Â Â Â Â class MyClass Â Â Â Â Â Â Â Â def initialize Â Â Â Â Â Â Â Â Â Â Â Â puts “hello” Â Â Â Â Â Â Â Â end Â Â Â Â end end
> 
> then the output is correct.

I’ve found the bug!

There is:

* * *

module MyModule

```
   class MyClass

           RUBY_VERSION_CORE = case RUBY_VERSION
                 when /^1\.9\./
                    :RUBY_1_9
                 when /^1\.8\./
                    :RUBY_1_8
                 end

           def initialize
                   puts "hello"
           end

   end

```

## end

Adding that “case” stament confuses RDoc and generates wrong output.  
You can check it by creating the above file and generating rdoc. The  
class method “initialize” will appear as a MyModule method.

Could somebody confirm it so I would report the bug? Thanks a lot.

---

<div class="post-metadata">

**Author:** ![ISSSSaki\_Baz\_C](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/51bf81/32.png) [@ISSSSaki\_Baz\_C](https://www.ruby-forum.com/u/ISSSSaki_Baz_C)\
**Post date:** [July 28, 2009, 11:04pm UTC](https://www.ruby-forum.com/t/rdoc-really-wrong-output-module-method-instead-of-module-class-method/172838/3 "2009-07-28T23:04:04Z")

</div>

On Jul 28, 2009, at 10:36, Iñaki Baz C. wrote:

> > module MyModule  
> > I’ve found the bug!  
> > when /^1.9./  
> > end
> 
> * * *
> 
> Adding that “case” stament confuses RDoc and generates wrong output.  
> You can check it by creating the above file and generating rdoc. The  
> class method “initialize” will appear as a MyModule method.
> 
> Could somebody confirm it so I would report the bug? Thanks a lot.

Can you file it in the tracker?

---

<div class="post-metadata">

**Author:** ![ISSSSaki\_Baz\_C](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/51bf81/32.png) [@ISSSSaki\_Baz\_C](https://www.ruby-forum.com/u/ISSSSaki_Baz_C)\
**Post date:** [July 28, 2009, 11:06pm UTC](https://www.ruby-forum.com/t/rdoc-really-wrong-output-module-method-instead-of-module-class-method/172838/4 "2009-07-28T23:06:25Z")

</div>

El Martes, 28 de Julio de 2009, Eric H.  
escribió:\> \> RUBY\_VERSION\_CORE = case RUBY\_VERSION

> > ```
> > def initialize
> > 
> > ```
> > 
> > class method “initialize” will appear as a MyModule method.
> > 
> > Could somebody confirm it so I would report the bug? Thanks a lot.
> 
> Can you file it in the tracker?

[http://rubyforge.org/tracker/index.php?func=detail&aid=26777&group\_id=627&atid=2472](http://rubyforge.org/tracker/index.php?func=detail&aid=26777&group_id=627&atid=2472)

🙂
