Permalink
Browse files

:method: is not needed when RDoc can detect it

  • Loading branch information...
1 parent 21eadc1 commit ae35a36afc616a0225d2f58da125abb318fd9b4a @spastorino spastorino committed Dec 2, 2010
Showing with 0 additions and 5 deletions.
  1. +0 −5 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 <tt>Object#send</tt> does.
#
@@ -28,15 +25,13 @@ 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
else
__send__(*a, &b)
end
end
-
end
class NilClass #:nodoc:

0 comments on commit ae35a36

Please sign in to comment.