From: "Hal E. Fulton" Date: 2002-10-18T09:12:46+09:00 Subject: Re: Hashes v.s. Classes (was Re: Strings or symbols?) ----- Original Message ----- From: "Anders Bengtsson" To: "ruby-talk ML" Sent: Thursday, October 17, 2002 1:14 PM Subject: Re: Hashes v.s. Classes (was Re: Strings or symbols?) > You can get the names of all instance variables of an object with > obj.instance_variables, so you could write something similar to the > above. > If you have everything in a Person class you can also let that class > know about the table structure the instances are stored in, so the > objects can store themselves even. True. Two other possibilities: 1. Give your class a to_hash method (maybe from_hash also) 2. Use a Struct Hal