Bug #5412

Array documentation

Added by madebydna (Andrea Singh) almost 9 years ago. Updated almost 9 years ago.

Target version:
ruby -v:


As a contribution to the Mendicant University drive to enhance MRI documentation, I've tackled documentation of the Array class. I've amplified the general description of the Array class and highlighted some of the more commonly used instance methods. I've also edited some of the method-level code samples.


Updated by drbrain (Eric Hodel) almost 9 years ago

It seems you have reindented the file by mistake, removing all the tabs. Please resubmit without changing the indentation.

See for help configuring your editor.

Updated by madebydna (Andrea Singh) almost 9 years ago

Sorry about that. I didn't notice that Textmate was deleting the tabs when I pasted the documentation text.

Anyway, I'm resubmitting the patch now.

Updated by drbrain (Eric Hodel) almost 9 years ago

Overall this patch is good, but needs some small adjustments.

The new additions to the top-level documentation should include a * even for blank lines.

When you're referring to other methods they should not be surrounded by "+" or "" so RDoc will link them. For example, use #compact instead of +compact+.

I think there is too much duplication with the documentation of the individual methods for Creating Arrays and Accessing Elements sections. Could you trim this down to avoid the duplication?

Updated by madebydna (Andrea Singh) almost 9 years ago

Hi Eric,

I made the adjustments you requested. I added the * for blank lines and linked the references to other methods where possible. In some instances, like for Array#<< or Array#[] adding the hash mark didn't create the link. Not sure if there's a workaround for that.

I also tried to trim down the two sections you mentioned (Creating Arrays and Accessing Array Elements). Let me know if you think this will work or whether you need me to edit it even further.




Updated by drbrain (Eric Hodel) almost 9 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

This issue was solved with changeset r33451.
Andrea, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.

  • array.c: Add a description to Array, minor cleanups. Patch by Andrea Singh. [Ruby 1.9 - Bug #5412]

Updated by drbrain (Eric Hodel) almost 9 years ago

I made a few minor changes to your patch:

I aligned the various example result (#=>) markers for better readability

I changed edited some wording for flow and removed some fancy words (like heterogenous) because they were explained in simpler english which is easier for non-english-speakers to understand.

Also available in: Atom PDF