Skip to content
Browse files

update docs on Object#try

  • Loading branch information...
1 parent 26e2c08 commit a7e0b2f843c4a6fdfe08a45c09d2ff44bcfe994e @nashby nashby committed May 13, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 activesupport/lib/active_support/core_ext/object/try.rb
View
2 activesupport/lib/active_support/core_ext/object/try.rb
@@ -24,7 +24,7 @@ class Object
# Without a method argument try will yield to the block unless the receiver is nil.
# @person.try { |p| "#{p.first_name} #{p.last_name}" }
#--
- # +try+ behaves like +Object#send+, unless called on +NilClass+.
+ # +try+ behaves like +Object#public_send+, unless called on +NilClass+.
def try(*a, &b)
if a.empty? && block_given?
yield self

0 comments on commit a7e0b2f

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