Sebastian Hungerecker
9/26/2008 6:07:00 PM
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