Jason Lillywhite wrote:
> The rdoc heading for Array[index] method says:
> 
> array[index] = obj вк obj
> 
> and for String.new:
> 
> String.new(str="") => new_str
> 
> When I document my own classes, how do I make the part that shows return
> values with the arrow appear? i.e. change_array(old_array) => new_array
> 
> I don't know how to comment my code such that the "=> new_array" would
> appear in rdoc.
> 
> Thank you.

You have to use the call-seq directive for that:
-----------------------

#call-seq:
#  my_method(str) ==> aString
#  my_method(str, true) ==> anInteger
#
#This is your normal method description.
def my_method(x, y = false)
  #Here goes your code...
end

-------------------------
Note the empty line between the method description header and the main 
description.

Marvin
-- 
Posted via http://www.ruby-forum.com/.