Mark Wilden:

> I'd be interested, however, in hearing about the benefits of opening
> the eigenclass to define class methods (apart from ease in searching,
> which may be best handled with ctags).

Such methods have access to the eigenclass’s instance variables, and so
class << self works very nice when working with singletons (like Log or
Config).

If you don’t use class << self, you have to work on class variables and
you can’t use the attr_* shorthands to access the singleton’s variables.

-- Shot
-- 
Smalltalk programmers do not type, they lean their heads towards
their monitors, and meditate. The more advanced programmers do
not even need monitors.               -- Phlip, comp.programming

Attachment: pgpTKpP2uev8h.pgp
Description: PGP signature

_______________________________________________
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users

Reply via email to