title: How do I get the Method object for a method?
body: <p>I'm trying to extend the Method class along the lines of:</p>
  
  <pre><code>irb(main):008:0&gt; class A
  irb(main):009:1&gt; def a
  irb(main):010:2&gt; puts "blah"
  irb(main):011:2&gt; end
  irb(main):012:1&gt; end
  =&gt; nil
  irb(main):013:0&gt; class Method
  irb(main):014:1&gt; def aa
  irb(main):015:2&gt; p "hi"
  irb(main):016:2&gt; end
  irb(main):017:1&gt; end
  =&gt; nil
  irb(main):018:0&gt; f = A.new
  =&gt; #&lt;A:0x54ed4&gt;
  irb(main):019:0&gt; A.a
  NoMethodError: undefined method `a' for A:Class
      from (irb):19
      from :0
  irb(main):020:0&gt; f.a
  blah
  =&gt; nil
  irb(main):027:0&gt; f.a.aa
  blah
  NoMethodError: undefined method `aa' for nil:NilClass
      from (irb):27
      from :0
  </code></pre>
  
  <p>As expected, when I <code>f.a.aa</code>, the <code>.aa</code> is being executed on the return value of <code>f.a</code>.  How do I gain access to the Method object which represents <code>f.a</code>?</p>