On Wed, Nov 26, 2008 at 5:23 AM, Shot (Piotr Szotkowski) <[EMAIL 
PROTECTED]>wrote:

>
> 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.
>

Right. I was talking about the difference between using "class << self" and
"def self.foo" when other things were equal. I do understand there are
situations (like the one you mention) where it's handy to be actually in the
eigenclass when defining methods.

///ark
_______________________________________________
rspec-users mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/rspec-users

Reply via email to