# Rdoc with readable hashes

**URL:** <https://www.ruby-forum.com/t/rdoc-with-readable-hashes/178444>\
**Category:** Ruby\
**Created:** [November 4, 2009, 7:58pm UTC](https://www.ruby-forum.com/t/rdoc-with-readable-hashes/178444 "2009-11-04T19:58:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![corck](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/90db22/32.png) [@corck](https://www.ruby-forum.com/u/corck)\
**Post date:** [November 4, 2009, 7:58pm UTC](https://www.ruby-forum.com/t/rdoc-with-readable-hashes/178444/1 "2009-11-04T19:58:51Z")

</div>

Hello,

I want to parse a ruby config of a window manager which utilizes hashes.  
Is there a way to get a fancier ouput than this?

## Template:

# 

# == Options

# 

# Following options change behaviour and sizes of the window manager:

# 

OPTIONS = {

# Border size in pixel of the windows

:border =\> 2,

# Window move/resize steps in pixel per keypress

:step =\> 5,

# Window screen border snapping

:snap =\> 10,

# Default starting gravity for windows

:gravity =\> :center,

# Make transient windows urgent

:urgent =\> true,

# Enable respecting of size hints globally

:resize =\> false,

# Screen size padding (left, right, top, bottom)

:padding =\> [0, 0, 0, 0],

# Font string (see xfontsel)

:font =\> “-_-fixed-_-_-_-_-10-_-_-_-_-_-_-_”  
}

Output:

---

<div class="post-metadata">

**Author:** ![corck](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/90db22/32.png) [@corck](https://www.ruby-forum.com/u/corck)\
**Post date:** [November 5, 2009, 4:40pm UTC](https://www.ruby-forum.com/t/rdoc-with-readable-hashes/178444/2 "2009-11-05T16:40:00Z")

</div>

> I want to parse a ruby config of a window manager which utilizes hashes.  
> Is there a way to get a fancier ouput than this?  
> …  
> OPTIONS = {
> 
> # Border size in pixel of the windows
> 
> :border =\> 2,
> 
> # Window move/resize steps in pixel per keypress
> 
> :step =\> 5,

…

You could duplicate the descriptions in the RDOC comment, or you try and  
use an rdoc directive like :method:

[http://rdoc.rubyforge.org/RDoc/Parser/Ruby.html](http://rdoc.rubyforge.org/RDoc/Parser/Ruby.html)

I think I’ve seen some docu that’s like

# 

# 

# param:: describe something that could be in args

# param2:: again

def go args  
end

but I’m not sure what that was for–yard?  
-r

---

<div class="post-metadata">

**Author:** ![corck](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/90db22/32.png) [@corck](https://www.ruby-forum.com/u/corck)\
**Post date:** [November 8, 2009, 5:17pm UTC](https://www.ruby-forum.com/t/rdoc-with-readable-hashes/178444/3 "2009-11-08T17:17:50Z")

</div>

On Nov 5, 2009, at 12:10 PM, Roger P. wrote:

> ## -r
> 
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).

YARD has @option:

class Test  
# Nice little method with hash-arg  
#  
# @option param :height [Fixnum, #to\_i] (300) The height  
# @option param :width [Fixnum, #to\_i] (200) The width  
#  
def test(param = {})

```
 end

```

end

I thing param:: an such was used by the Merb team.

Regards,  
Florian
