提交 cebe5c2f 编写于 作者: S Santiago Pastorino 提交者: Aaron Patterson

It's not needed to initialize the attr when calling mattr_writer

上级 7aec9f9c
......@@ -5,9 +5,7 @@ def mattr_reader(*syms)
options = syms.extract_options!
syms.each do |sym|
class_eval(<<-EOS, __FILE__, __LINE__ + 1)
unless defined? @@#{sym}
@@#{sym} = nil
end
@@#{sym} = nil unless defined? @@#{sym}
def self.#{sym}
@@#{sym}
......@@ -28,10 +26,6 @@ def mattr_writer(*syms)
options = syms.extract_options!
syms.each do |sym|
class_eval(<<-EOS, __FILE__, __LINE__ + 1)
unless defined? @@#{sym}
@@#{sym} = nil
end
def self.#{sym}=(obj)
@@#{sym} = obj
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册