From 4072de266a74edf4f432a200a322cf1ffd38d78e Mon Sep 17 00:00:00 2001 From: Francesco Rodriguez Date: Mon, 4 Jun 2012 23:21:48 -0500 Subject: remove double hyphen that doesn't allow properly parsing --- activesupport/lib/active_support/core_ext/object/try.rb | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'activesupport/lib/active_support/core_ext') diff --git a/activesupport/lib/active_support/core_ext/object/try.rb b/activesupport/lib/active_support/core_ext/object/try.rb index 30c835f5cd..16a799ec03 100644 --- a/activesupport/lib/active_support/core_ext/object/try.rb +++ b/activesupport/lib/active_support/core_ext/object/try.rb @@ -11,8 +11,6 @@ class Object # subclasses of +BasicObject+. For example, using try with +SimpleDelegator+ will # delegate +try+ to target instead of calling it on delegator itself. # - # ==== Examples - # # Without +try+ # @person && @person.name # or @@ -27,7 +25,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#public_send+, unless called on +NilClass+. def try(*a, &b) if a.empty? && block_given? @@ -42,8 +40,6 @@ class NilClass # Calling +try+ on +nil+ always returns +nil+. # It becomes specially helpful when navigating through associations that may return +nil+. # - # === Examples - # # nil.try(:name) # => nil # # Without +try+ -- cgit v1.2.3