Skip to content
This repository
Browse code

Improve docs for `try` by adding note on `BasicObject`

[ci skip] closes #5790
  • Loading branch information...
commit 2575508a385f4a8003ea1277025c018583971e1d 1 parent cae1ca7
Piotr Sarnacki authored May 20, 2012
4  activesupport/lib/active_support/core_ext/object/try.rb
@@ -7,6 +7,10 @@ class Object
7 7
   #
8 8
   # If try is called without a method to call, it will yield any given block with the object.
9 9
   #
  10
+  # Please also note that +try+ is defined on +Object+, therefore it won't work with
  11
+  # subclasses of +BasicObject+. For example, using try with +SimpleDelegator+ will
  12
+  # delegate +try+ to target instead of calling it on delegator itself.
  13
+  #
10 14
   # ==== Examples
11 15
   #
12 16
   # Without +try+

0 notes on commit 2575508

Please sign in to comment.
Something went wrong with that request. Please try again.