diff options
author | Piotr Sarnacki <drogus@gmail.com> | 2012-05-20 00:24:35 -0700 |
---|---|---|
committer | Piotr Sarnacki <drogus@gmail.com> | 2012-05-20 00:30:58 -0700 |
commit | 6ef9fda1a39f45e2d18aba4881f60a19589a2c77 (patch) | |
tree | 4b13d9c08ef74eadf8e91b53124ac426660911a8 /activesupport/lib | |
parent | 0d73d6e7b6dd1900f105397460b777ef6c03d3b6 (diff) | |
download | rails-6ef9fda1a39f45e2d18aba4881f60a19589a2c77.tar.gz rails-6ef9fda1a39f45e2d18aba4881f60a19589a2c77.tar.bz2 rails-6ef9fda1a39f45e2d18aba4881f60a19589a2c77.zip |
Improve docs for `try` by adding note on `BasicObject`
[ci skip] closes #5790
Diffstat (limited to 'activesupport/lib')
-rw-r--r-- | activesupport/lib/active_support/core_ext/object/try.rb | 4 |
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 e77a9da0ec..5fb2e31b12 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+ |