From 6ef9fda1a39f45e2d18aba4881f60a19589a2c77 Mon Sep 17 00:00:00 2001 From: Piotr Sarnacki Date: Sun, 20 May 2012 00:24:35 -0700 Subject: [PATCH] Improve docs for `try` by adding note on `BasicObject` [ci skip] closes #5790 --- activesupport/lib/active_support/core_ext/object/try.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/activesupport/lib/active_support/core_ext/object/try.rb b/activesupport/lib/active_support/core_ext/object/try.rb index e77a9da0ec20d..5fb2e31b12714 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+