[rspec-users] class << self considered harmful... really?

Mark Wilden mark at mwilden.com
Wed Nov 26 11:54:35 EST 2008


On Wed, Nov 26, 2008 at 8:47 AM, Avdi Grimm <avdi at avdi.org> wrote:


>    class << self
>      attr_accessor :class_var
>    end
>

Also, with Rails, you could do

 cattr_accessor :class_var

which has the same readability benefits as 'def self.foo'

///ark
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20081126/0e7d65f9/attachment.html>


More information about the rspec-users mailing list