From: Pat Maddox Date: 2006-05-14T19:52:08+09:00 Subject: Re: "Seeing Metaclasses Clearly" On 5/14/06, Ross Bamford wrote: > I.e. you're making an instance method named for the argument passed into > the class-level 'company'. ruby is pretty relaxed about that, but > obviously it can't be called without using send. Well that was kind of a stupid mistake on my part. > Switching to 'define_method(:company) { name }' made it work as (I > think) _why intended. Actually, it doesn't. Your code lets me do HappyTruck.new.company but why's code doesn't. His code does HappyTruck.company Which struck me as kind of useless, to be honest. If you're going to make it a class-level method, why do all the metaclass stuff? What's wrong with: class HappyTruck < MailTruck def self.company; "Happy Truck Company"; end end That is a much more direct way to achieve the same result, at least as far as I can tell. Okay actually even if I did it your way it seems like it would make a lot more sense to just do class HappyTruck < MailTruck def company; "Happy Truck Company"; end end I'm REALLY not understanding this stuff now :\ Pat