From: Daniel Berger Date: 2009-02-04T15:20:21+09:00 Subject: Method.new - why not? Hi, Just a random thought that I think was inspired by several people on the list asking about getting the name of the method from within the method - why don't we have Method.new? In other words, what if this: def foo(x, y=1) end Was the equivalent of this? x = Method.new(:name => 'foo', :parameters => ['x', 'y'], :defaults => {'y' => 1}) Object.include(x) # or bind(x) or something Similar to an UnboundMethod I suppose, but with more options. Wouldn't it be easier to get method metadata with this approach? And give programmers the ability to associate any methods with any class or module? class Bar def foo(x, y=1) p method(:foo).metadata # => @name => 'foo', @parameters => ['x','y'], :defaults => {'y' => 1}) end end Or is this totally stupid? If this has been discussed before just point me to the thread. Regards, Dan