From: Kris Helenek Date: 2007-04-19T05:50:15+09:00 Subject: Re: to_s mixin/reflection/newbie stuff Thanks Hemant! I still have trouble seeing things as methods without the parentheses(); but it makes perfect sense now. And i wrote a nice little module to duplicate what is often done to create good debug output in hibernate (j2ee world): module ReflectionToString def to_s str = self.class.name + "[" for attribute in self.attributes str += attribute[0].to_s + ": " + attribute[1].to_s + ", " end str += "]" str end end Someone could probably clean it up a bit but its just a first pass... I have a Rails specific question (i know this is kinda the wrong forum, but I'm already here..) Where is the appropriate place to store this module? In the helper or model folder? lib? A new folder? Don't know the conventions yet and I haven't seen anything about utility classes yet... thanks again. -- Posted via http://www.ruby-forum.com/.