Navigation Menu

Skip to content

Commit

Permalink
Fix 'warning: method redefined' [#5551 state:resolved]
Browse files Browse the repository at this point in the history
Signed-off-by: José Valim <jose.valim@gmail.com>
  • Loading branch information
krekoten authored and josevalim committed Sep 25, 2010
1 parent 8639c10 commit 1b7d30b
Showing 1 changed file with 4 additions and 4 deletions.
Expand Up @@ -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

0 comments on commit 1b7d30b

Please sign in to comment.