From a7e0b2f843c4a6fdfe08a45c09d2ff44bcfe994e Mon Sep 17 00:00:00 2001 From: Vasiliy Ermolovich Date: Sun, 13 May 2012 14:25:41 +0300 Subject: update docs on Object#try --- activesupport/lib/active_support/core_ext/object/try.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activesupport/lib/active_support') diff --git a/activesupport/lib/active_support/core_ext/object/try.rb b/activesupport/lib/active_support/core_ext/object/try.rb index 40a8101ca3..3e63b1e82a 100644 --- a/activesupport/lib/active_support/core_ext/object/try.rb +++ b/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 -- cgit v1.2.3