From 8ba491acc31bf08cf63a83ea0a3c314c52cd020f Mon Sep 17 00:00:00 2001 From: Jon Leighton Date: Thu, 25 Aug 2011 18:51:17 +0100 Subject: Revert all the stuff to do with disallowing non-public methods for Module#delegate --- .../source/active_support_core_extensions.textile | 24 ---------------------- 1 file changed, 24 deletions(-) (limited to 'railties/guides') diff --git a/railties/guides/source/active_support_core_extensions.textile b/railties/guides/source/active_support_core_extensions.textile index df863935cf..b2436a2e68 100644 --- a/railties/guides/source/active_support_core_extensions.textile +++ b/railties/guides/source/active_support_core_extensions.textile @@ -452,30 +452,6 @@ Examples of +in?+: NOTE: Defined in +active_support/core_ext/object/inclusion.rb+. -h4. +public_send+ - -This method is available by default in Ruby 1.9, and is backported to Ruby 1.8 by Active Support. Like the regular +send+ method, +public_send+ allows you to call a method when the name is not known until runtime. However, if the method is not public then a +NoMethodError+ exception will be raised. - - -class Greeter - def hello(who) - "Hello " + who - end - - private - - def secret - "sauce" - end -end - -greeter = Greeter.new -greeter.public_send(:hello, 'Jim') # => "Hello Jim" -greeter.public_send(:secret) # => NoMethodError - - -NOTE: Defined in +active_support/core_ext/object/public_send.rb+. - h3. Extensions to +Module+ h4. +alias_method_chain+ -- cgit v1.2.3