diff options
author | Vasiliy Ermolovich <younash@gmail.com> | 2012-05-13 14:25:41 +0300 |
---|---|---|
committer | Vasiliy Ermolovich <younash@gmail.com> | 2012-05-13 14:25:41 +0300 |
commit | a7e0b2f843c4a6fdfe08a45c09d2ff44bcfe994e (patch) | |
tree | ea26c785ad474945656c47c913cf822d3ab7b94c /activesupport/lib/active_support | |
parent | 26e2c082595ecca360954cfc20ecc52221748f7b (diff) | |
download | rails-a7e0b2f843c4a6fdfe08a45c09d2ff44bcfe994e.tar.gz rails-a7e0b2f843c4a6fdfe08a45c09d2ff44bcfe994e.tar.bz2 rails-a7e0b2f843c4a6fdfe08a45c09d2ff44bcfe994e.zip |
update docs on Object#try
Diffstat (limited to 'activesupport/lib/active_support')
-rw-r--r-- | activesupport/lib/active_support/core_ext/object/try.rb | 2 |
1 files changed, 1 insertions, 1 deletions
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 |