Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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

[ci skip] closes #5790
  • Loading branch information...
commit 2575508a385f4a8003ea1277025c018583971e1d 1 parent cae1ca7
Piotr Sarnacki drogus authored
Showing with 4 additions and 0 deletions.
  1. +4 −0 activesupport/lib/active_support/core_ext/object/try.rb
4 activesupport/lib/active_support/core_ext/object/try.rb
View
@@ -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+
Please sign in to comment.
Something went wrong with that request. Please try again.