aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport
diff options
context:
space:
mode:
authorZachary Scott <e@zzak.io>2014-10-24 13:10:50 -0700
committerZachary Scott <e@zzak.io>2014-10-24 13:10:50 -0700
commitea3cd40554a674989275e8b24f382e3c6409ce5a (patch)
treed2e369846180fecd82c767a19097426034c96c23 /activesupport
parentdf1dda8b71023d1f76e9ee827e2aca6f8a5ec3c0 (diff)
downloadrails-ea3cd40554a674989275e8b24f382e3c6409ce5a.tar.gz
rails-ea3cd40554a674989275e8b24f382e3c6409ce5a.tar.bz2
rails-ea3cd40554a674989275e8b24f382e3c6409ce5a.zip
Include return value in examples added in #17378 [ci skip]
Diffstat (limited to 'activesupport')
-rw-r--r--activesupport/lib/active_support/core_ext/object/try.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/activesupport/lib/active_support/core_ext/object/try.rb b/activesupport/lib/active_support/core_ext/object/try.rb
index 0bc675329d..5b5729eb92 100644
--- a/activesupport/lib/active_support/core_ext/object/try.rb
+++ b/activesupport/lib/active_support/core_ext/object/try.rb
@@ -21,11 +21,11 @@ class Object
#
# +try+ will also return +nil+ if the receiver does not respond to the method:
#
- # @person.try(:non_existing_method)
+ # @person.try(:non_existing_method) #=> nil
#
# instead of
#
- # @person.non_existing_method if @person.respond_to?(:non_existing_method)
+ # @person.non_existing_method if @person.respond_to?(:non_existing_method) #=> nil
#
# +try+ returns +nil+ when called on +nil+ regardless of whether it responds
# to the method: