aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/core_ext/object
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2010-09-11 20:50:35 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2010-09-11 20:51:02 -0700
commit8c6de675e49d78244c5936f6e5c31e46f7c21377 (patch)
tree96ed42faaeda5cbec8e7d20e125208a55bc0c0f2 /activesupport/lib/active_support/core_ext/object
parent9a8861f2e4080fe19b9cb1f10e39ba0110d1da7b (diff)
downloadrails-8c6de675e49d78244c5936f6e5c31e46f7c21377.tar.gz
rails-8c6de675e49d78244c5936f6e5c31e46f7c21377.tar.bz2
rails-8c6de675e49d78244c5936f6e5c31e46f7c21377.zip
Remove dummy method definition in favor of RDoc hints:
http://rdoc.rubyforge.org/RDoc/Parser/Ruby.html
Diffstat (limited to 'activesupport/lib/active_support/core_ext/object')
-rw-r--r--activesupport/lib/active_support/core_ext/object/try.rb12
1 files changed, 5 insertions, 7 deletions
diff --git a/activesupport/lib/active_support/core_ext/object/try.rb b/activesupport/lib/active_support/core_ext/object/try.rb
index a1c63a0e54..48e9d04787 100644
--- a/activesupport/lib/active_support/core_ext/object/try.rb
+++ b/activesupport/lib/active_support/core_ext/object/try.rb
@@ -1,4 +1,7 @@
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.
#
@@ -19,13 +22,8 @@ class Object
# Person.try(:find, 1)
# @people.try(:collect) {|p| p.name}
#--
- # This method definition below is for rdoc purposes only. The alias_method call
- # below overrides it as an optimization since +try+ behaves like +Object#send+,
- # unless called on +NilClass+.
- def try(method, *args, &block)
- send(method, *args, &block)
- end
- remove_method :try
+ # +try+ behaves like +Object#send+, unless called on +NilClass+.
+
alias_method :try, :__send__
end