-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 | it's strange your model :-))) Hey Guy! Thanks, it worked, but too much for a newbie, I need to take a look and learn with this now. You scared me ahahah, I told you I was a newbie. :-) I didn't know that there was "self" on Ruby, for example. :-) And what about that instance_eval and inherited there? Ahhh. :-) Thanks! :-) | | class CarBuilder | def self.inherited(kl) | kl.instance_eval { @total_of_cars = 0 } | super | end | | def build | puts "#{self.class} building another car ..." | self.class.instance_eval { @total_of_cars += 1 } | end | | def total_of_cars | "#{self.class} built #{self.class.instance_eval { @total_of_cars }} cars" | end | end | | class Honda < CarBuilder | end | | class Ford < CarBuilder | end - ---------------------------- Eust?quio "TaQ" Rangel eustaquiorangel / yahoo.com http://beam.to/taq Usu?rio GNU/Linux no. 224050 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.6 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFB1Aokb6UiZnhJiLsRAs0oAKC2uZAh8MB2amkV96JtIqa3vgQ6xACfUn3Y EV+7wuTrWDyD8tq1LxBaV9w= =DDYu -----END PGP SIGNATURE-----