From: Sebastian Hungerecker Date: 2008-09-27T03:07:27+09:00 Subject: Re: How to iterate of the attributes of an object? Rich Sturim wrote: > I need to build a string of all populated attributes of a given object. > > I need to get the attribute name and it's value Define "attribute". You can print a list of instance variables and their values like this: puts instance_variables.map {|var| "#{var}: #{instance_variable_get(var)}"} HTH, Sebastian -- Jabber: sepp2k@jabber.org ICQ: 205544826