# Rdoc

**URL:** <https://www.ruby-forum.com/t/rdoc/176444>\
**Category:** Ruby\
**Created:** [September 30, 2009, 5:33pm UTC](https://www.ruby-forum.com/t/rdoc/176444 "2009-09-30T17:33:57Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![martin-ga](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/9fc348/32.png) [@martin-ga](https://www.ruby-forum.com/u/martin-ga)\
**Post date:** [September 30, 2009, 5:33pm UTC](https://www.ruby-forum.com/t/rdoc/176444/1 "2009-09-30T17:33:57Z")

</div>

Hello,

Is there a way to specify the return value of a method in rdoc?

I would like my rdoc documentation to look like the ruby-core-api:  
“method\_name(param1, param2) =\> return\_value”

Thanks for helping

---

<div class="post-metadata">

**Author:** ![martin-ga](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/9fc348/32.png) [@martin-ga](https://www.ruby-forum.com/u/martin-ga)\
**Post date:** [September 30, 2009, 5:51pm UTC](https://www.ruby-forum.com/t/rdoc/176444/2 "2009-09-30T17:51:47Z")

</div>

Martin GÃ¼tlein wrote:

> Hello,
> 
> Is there a way to specify the return value of a method in rdoc?
> 
> I would like my rdoc documentation to look like the ruby-core-api:  
> “method\_name(param1, param2) =\> return\_value”
> 
> Thanks for helping

# You can override the whole calling string with #call-seq:

#!/usr/bin/env ruby  
#Encoding: UTF-8

#That’s my class.  
class A

#call-seq:

# A#my\_method ==\> 27

# 

#And this is my method.  
def my\_method  
27  
end

# end

Note the blank line between the calling string (which may be multiline)  
and the method description.  
If you speak German, you may want to have a look here:  
[http://wiki.ruby-portal.de/RDoc](http://wiki.ruby-portal.de/RDoc)  
If not, I’d like to point you to the official RDoc documentation at  
[RDoc Documentation](http://rdoc.sourceforge.net/doc/index.html) (but I wasn’t able to find  
the #call-seq directive there till now)

Marvin

---

<div class="post-metadata">

**Author:** ![martin-ga](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/9fc348/32.png) [@martin-ga](https://www.ruby-forum.com/u/martin-ga)\
**Post date:** [September 30, 2009, 5:55pm UTC](https://www.ruby-forum.com/t/rdoc/176444/3 "2009-09-30T17:55:51Z")

</div>

At 2009-09-30 11:33AM, “Martin Gütlein” wrote:

> Hello,
> 
> Is there a way to specify the return value of a method in rdoc?
> 
> I would like my rdoc documentation to look like the ruby-core-api:  
> “method\_name(param1, param2) =\> return\_value”
> 
> Thanks for helping

Use the “call-seq:” directive

```
# ... comments about this method ...
#
# call-seq:
# method_name(param1, param2) => return_value
#
def method_name(first_param, second_param)
  ...

```

Note the parameter names in the call-seq don’t have to match what you  
actually use in your code.
