<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1680,7 +1680,47 @@ The method +Range#overlaps?+ says whether any two given ranges have non-void int
 
 h3. Extensions to +Proc+
 
-...
+h4. +bind+
+
+As you surely know Ruby has an +UnboundMethod+ class whose instances are methods that belong to the limbo of methods without a self. The method +Module#instance_method+ returns an unbound method for example:
+
+&lt;ruby&gt;
+Hash.instance_method(:delete) # =&gt; #&lt;UnboundMethod: Hash#delete&gt;
+&lt;/ruby&gt;
+
+An unbound method is not callable as is, you need to bind it first to an object with +bind+:
+
+&lt;ruby&gt;
+clear = Hash.instance_method(:clear)
+clear.bind({:a =&gt; 1}).call # =&gt; {}
+&lt;/ruby&gt;
+
+Active Support defines +Proc#bind+ with an analogous purpose:
+
+&lt;ruby&gt;
+Proc.new { size }.bind([]).call # =&gt; 0
+&lt;/ruby&gt;
+
+As you see that's callable and bound to the argument, the return value is indeed a +Method+.
+
+NOTE: To do so +Proc#bind+ actually creates a method under the hood. If you ever see a method with a weird name like +__bind_1256598120_237302+ in a stack trace you know now where it comes from.
+
+Action Pack uses this trick in +rescue_from+ for example, which accepts the name of a method and also a proc as callbacks for a given rescued exception. It has to call them in either case, so a bound method is returned by +handler_for_rescue+, thus simplifying the code in the caller:
+
+&lt;ruby&gt;
+def handler_for_rescue(exception)
+  _, rescuer = Array(rescue_handlers).reverse.detect do |klass_name, handler|
+    ...
+  end
+
+  case rescuer
+  when Symbol
+    method(rescuer)
+  when Proc
+    rescuer.bind(self)
+  end
+end
+&lt;/ruby&gt;
 
 h3. Extensions to +Date+
 </diff>
      <filename>railties/guides/source/active_support_core_extensions.textile</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>d226287855800e1eec58cd35ed3aac5cd9fbf630</id>
    </parent>
  </parents>
  <author>
    <name>Xavier Noria</name>
    <email>fxn@hashref.com</email>
  </author>
  <url>http://github.com/lifo/docrails/commit/f37c90a8758d4dc007ad6a3428769651981ea4f4</url>
  <id>f37c90a8758d4dc007ad6a3428769651981ea4f4</id>
  <committed-date>2009-10-26T16:11:22-07:00</committed-date>
  <authored-date>2009-10-26T16:11:22-07:00</authored-date>
  <message>AS guide: documents Proc#bind</message>
  <tree>41b0af00875a76c6002c3afc24e359d753c734b9</tree>
  <committer>
    <name>Xavier Noria</name>
    <email>fxn@hashref.com</email>
  </committer>
</commit>
