def mattr_writer(*syms)
      syms.each do |sym|
        raise NameError.new("invalid attribute name: #{sym}") unless sym =~ /^[_A-Za-z]\w*$/
        class_eval(<<-EOS, __FILE__, __LINE__ + 1)
          @@#{sym} = nil unless defined? @@#{sym}
          def self.#{sym}=(obj)
            @@#{sym} = obj
          end
        EOS

        send("#{sym}=", yield) if block_given?
      end
    end
def mattr_writer(*syms)
      syms.each do |sym|
        raise NameError.new("invalid attribute name: #{sym}") unless sym =~ /^[_A-Za-z]\w*$/
        class_eval(<<-EOS, __FILE__, __LINE__ + 1)
          @@#{sym} = nil unless defined? @@#{sym}
          def self.#{sym}=(obj)
            @@#{sym} = obj
          end
        EOS

        send("#{sym}=", yield) if block_given?
      end
    end
Defines a class attribute and creates a class and instance writer methods to
 allow assignment to the attribute.