Skip to content

Commit 5446842

Browse files
Merge pull request rails#43352 from lewispb/lb/clarify-try
Clarify try is like public_send in the guides [ci-skip]
2 parents 2ed5896 + 0f1cdec commit 5446842

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

guides/source/active_support_core_extensions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ NOTE: Defined in `active_support/core_ext/object/deep_dup.rb`.
220220

221221
### `try`
222222

223-
When you want to call a method on an object only if it is not `nil`, the simplest way to achieve it is with conditional statements, adding unnecessary clutter. The alternative is to use [`try`][Object#try]. `try` is like `Object#send` except that it returns `nil` if sent to `nil`.
223+
When you want to call a method on an object only if it is not `nil`, the simplest way to achieve it is with conditional statements, adding unnecessary clutter. The alternative is to use [`try`][Object#try]. `try` is like `Object#public_send` except that it returns `nil` if sent to `nil`.
224224

225225
Here is an example:
226226

0 commit comments

Comments
 (0)