Ruby 1.9 compat: define __setobj__ for Delegator

This commit is contained in:
Jeremy Kemper
2008-05-10 10:47:06 -05:00
parent d2212c1601
commit 828914a062

View File

@@ -178,15 +178,19 @@ module ActiveSupport
class DeprecatedInstanceVariable < Delegator #:nodoc:
def initialize(value, method)
super(value)
@method = method
@value = value
super(value)
__setobj__(value)
end
def __getobj__
ActiveSupport::Deprecation.warn("Instance variable @#{@method} is deprecated! Call instance method #{@method} instead.")
@value
end
def __setobj__(value)
@value = value
end
end
end