Skip to content

Commit 6ef9fda

Browse files
committed
Improve docs for try by adding note on BasicObject
[ci skip] closes rails#5790
1 parent 0d73d6e commit 6ef9fda

File tree

1 file changed

+4
-0
lines changed
  • activesupport/lib/active_support/core_ext/object

1 file changed

+4
-0
lines changed

activesupport/lib/active_support/core_ext/object/try.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ class Object
77
#
88
# If try is called without a method to call, it will yield any given block with the object.
99
#
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+
#
1014
# ==== Examples
1115
#
1216
# Without +try+

0 commit comments

Comments
 (0)