aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/deprecation/proxy_wrappers.rb
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2012-09-13 14:02:18 -0300
committerRafael Mendonça França <rafaelmfranca@gmail.com>2012-09-13 14:02:18 -0300
commit8692db59af8f0dc468b588963622e61ff982a925 (patch)
tree968eddba8d75cb8f043bd77313866ba40e6801a8 /activesupport/lib/active_support/deprecation/proxy_wrappers.rb
parent1726a94900f86f19bcf1faf1afc06455607a8b59 (diff)
downloadrails-8692db59af8f0dc468b588963622e61ff982a925.tar.gz
rails-8692db59af8f0dc468b588963622e61ff982a925.tar.bz2
rails-8692db59af8f0dc468b588963622e61ff982a925.zip
Copy-edit deprecation relared documentation [ci skip]
Diffstat (limited to 'activesupport/lib/active_support/deprecation/proxy_wrappers.rb')
-rw-r--r--activesupport/lib/active_support/deprecation/proxy_wrappers.rb45
1 files changed, 23 insertions, 22 deletions
diff --git a/activesupport/lib/active_support/deprecation/proxy_wrappers.rb b/activesupport/lib/active_support/deprecation/proxy_wrappers.rb
index 2b8282c34e..17e69c34a5 100644
--- a/activesupport/lib/active_support/deprecation/proxy_wrappers.rb
+++ b/activesupport/lib/active_support/deprecation/proxy_wrappers.rb
@@ -27,14 +27,13 @@ module ActiveSupport
# This DeprecatedObjectProxy transforms object to depracated object.
#
- # Example
# @old_object = DeprecatedObjectProxy.new(Object.new, "Don't use this object anymore!")
- # Example with custom deprecator
# @old_object = DeprecatedObjectProxy.new(Object.new, "Don't use this object anymore!", deprecator_instance)
#
- # When someone execute any method expect +inspect+ on proxy object this will trigger +warn+ method on +deprecator_instance+
+ # When someone execute any method expect +inspect+ on proxy object this will
+ # trigger +warn+ method on +deprecator_instance+.
#
- # Default deprecator is ActiveSupport::Deprecation
+ # Default deprecator is <tt>ActiveSupport::Deprecation</tt>
class DeprecatedObjectProxy < DeprecationProxy
def initialize(object, message, deprecator = ActiveSupport::Deprecation.instance)
@object = object
@@ -52,28 +51,30 @@ module ActiveSupport
end
end
- # This DeprecatedInstanceVariableProxy transforms instance variable to depracated instance variable.
+ # This DeprecatedInstanceVariableProxy transforms instance variable to
+ # depracated instance variable.
#
- # Example
- # class Example
- # def initialize(deprecator)
- # @request = ActiveSupport::Deprecation::DeprecatedInstanceVariableProxy.new(self, :request, :@request, deprecator)
- # @_request = :a_request
- # end
+ # class Example
+ # def initialize(deprecator)
+ # @request = ActiveSupport::Deprecation::DeprecatedInstanceVariableProxy.new(self, :request, :@request, deprecator)
+ # @_request = :a_request
+ # end
#
- # def request
+ # def request
# @_request
# end
#
- # def old_request
+ # def old_request
# @request
- # end
- # end
+ # end
+ # end
#
- # When someone execute any method on @request variable this will trigger +warn+ method on +deprecator_instance+
- # and will fetch @_request variable via +request+ method and execute the same method on non-proxy instance variable.
+ # When someone execute any method on @request variable this will trigger
+ # +warn+ method on +deprecator_instance+ and will fetch <tt>@_request</tt>
+ # variable via +request+ method and execute the same method on non-proxy
+ # instance variable.
#
- # Default deprecator is ActiveSupport::Deprecation
+ # Default deprecator is <tt>ActiveSupport::Deprecation</tt>.
class DeprecatedInstanceVariableProxy < DeprecationProxy
def initialize(instance, method, var = "@#{method}", deprecator = ActiveSupport::Deprecation.instance)
@instance = instance
@@ -94,13 +95,13 @@ module ActiveSupport
# This DeprecatedConstantProxy transforms constant to depracated constant.
#
- # Example
# OLD_CONST = ActiveSupport::Deprecation::DeprecatedConstantProxy.new('OLD_CONST', 'NEW_CONST')
- # Example with custom deprecator
# OLD_CONST = ActiveSupport::Deprecation::DeprecatedConstantProxy.new('OLD_CONST', 'NEW_CONST', deprecator_instance)
- # When someone use old constant this will trigger +warn+ method on +deprecator_instance+
#
- # Default deprecator is ActiveSupport::Deprecation
+ # When someone use old constant this will trigger +warn+ method on
+ # +deprecator_instance+.
+ #
+ # Default deprecator is <tt>ActiveSupport::Deprecation</tt>.
class DeprecatedConstantProxy < DeprecationProxy
def initialize(old_const, new_const, deprecator = ActiveSupport::Deprecation.instance)
@old_const = old_const