提交 1b7d30bf 编写于 作者: K Krekoten' Marjan 提交者: José Valim

Fix 'warning: method redefined' [#5551 state:resolved]

Signed-off-by: NJosé Valim <jose.valim@gmail.com>
上级 8639c10a
......@@ -21,10 +21,10 @@ class Module
def attr_accessor_with_default(sym, default = Proc.new)
define_method(sym, block_given? ? default : Proc.new { default })
module_eval(<<-EVAL, __FILE__, __LINE__ + 1)
def #{sym}=(value) # def age=(value)
class << self; attr_reader :#{sym} end # class << self; attr_reader :age end
@#{sym} = value # @age = value
end # end
def #{sym}=(value) # def age=(value)
class << self; attr_accessor :#{sym} end # class << self; attr_accessor :age end
@#{sym} = value # @age = value
end # end
EVAL
end
end
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册