aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport
diff options
context:
space:
mode:
authorPiotr Sarnacki <drogus@gmail.com>2012-05-20 00:24:35 -0700
committerPiotr Sarnacki <drogus@gmail.com>2012-05-20 00:29:30 -0700
commit2575508a385f4a8003ea1277025c018583971e1d (patch)
tree4af50fb2364523380cb24329d63fc758add516e2 /activesupport
parentcae1ca7d1be9c79c7ef012a1f62aef9d3bb815f8 (diff)
downloadrails-2575508a385f4a8003ea1277025c018583971e1d.tar.gz
rails-2575508a385f4a8003ea1277025c018583971e1d.tar.bz2
rails-2575508a385f4a8003ea1277025c018583971e1d.zip
Improve docs for `try` by adding note on `BasicObject`
[ci skip] closes #5790
Diffstat (limited to 'activesupport')
-rw-r--r--activesupport/lib/active_support/core_ext/object/try.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/activesupport/lib/active_support/core_ext/object/try.rb b/activesupport/lib/active_support/core_ext/object/try.rb
index 48eb546a7d..30c835f5cd 100644
--- a/activesupport/lib/active_support/core_ext/object/try.rb
+++ b/activesupport/lib/active_support/core_ext/object/try.rb
@@ -7,6 +7,10 @@ class Object
#
# If try is called without a method to call, it will yield any given block with the object.
#
+ # Please also note that +try+ is defined on +Object+, therefore it won't work with
+ # subclasses of +BasicObject+. For example, using try with +SimpleDelegator+ will
+ # delegate +try+ to target instead of calling it on delegator itself.
+ #
# ==== Examples
#
# Without +try+