On 7/02/2006, at 10:36 AM, softwareengineer 99 wrote:
> This is a very basic question but I cannot find the
''right'' answer.
>
> What is the best way to traverse an object / array with ROR.
>
> I need to look at the structure of some of the objects/ arrays but
> not sure how to go about it.
For an array:
array.each do |item|
// stuff with item
end
An object is trickier, they''re not supposed to be traversed like an
array. Check out ruby-doc.org, the 1.8 reference documentation, the
interesting methods are in the Object and Module classes
--
Phillip Hutchings
phillip.hutchings@sitharus.com
http://www.sitharus.com/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2234 bytes
Desc: not available
Url :
http://wrath.rubyonrails.org/pipermail/rails/attachments/20060206/678d1827/smime.bin