Class: ActiveSupport::Deprecation::DeprecatedInstanceVariable

Inherits:
Delegator
  • Object
show all
Defined in:
lib/active_support/deprecation.rb

Instance Method Summary collapse

Constructor Details

#initialize(value, method) ⇒ DeprecatedInstanceVariable

Returns a new instance of DeprecatedInstanceVariable.



181
182
183
184
185
# File 'lib/active_support/deprecation.rb', line 181

def initialize(value, method)
  super(value)
  @method = method
  @value = value
end

Instance Method Details

#__getobj__Object



187
188
189
190
# File 'lib/active_support/deprecation.rb', line 187

def __getobj__
  ActiveSupport::Deprecation.warn("Instance variable @#{@method} is deprecated! Call instance method #{@method} instead.")
  @value
end