diff --git a/activesupport/lib/active_support/core_ext/object/try.rb b/activesupport/lib/active_support/core_ext/object/try.rb index 4d742b9ed2b5688e50b27ab8086d8e6e227bbcd3..ff812234e30db85540b6f9e43c78969afb562b18 100644 --- a/activesupport/lib/active_support/core_ext/object/try.rb +++ b/activesupport/lib/active_support/core_ext/object/try.rb @@ -1,7 +1,4 @@ class Object - ## - # :method: try - # # Invokes the method identified by the symbol +method+, passing it any arguments # and/or the block specified, just like the regular Ruby Object#send does. # @@ -28,7 +25,6 @@ class Object # @person.try { |p| "#{p.first_name} #{p.last_name}" } #-- # +try+ behaves like +Object#send+, unless called on +NilClass+. - def try(*a, &b) if a.empty? && block_given? yield self @@ -36,7 +32,6 @@ def try(*a, &b) __send__(*a, &b) end end - end class NilClass #:nodoc: