Reflection to find out the names of method arguments

Hello

Is there a way to dynamically find out the names of a method's
arguments ?

class ABusinessObject
def doBook( person, pickup, dropoff )
end
end

businessobject.method( 'doBook' ).arity # gives 3, the number of
arguments
businessobject.method('doBook').arguments # [ 'person', 'pickup',
'dropoff' ] any ideas how to do this?

I know Rdoc does this by parsing the source code, but I'd like to do
it dynamically.

The reason? I'm messing around trying to write a 'naked objects' (
http://www.nakedobjects.org/no-approach.html#no-approach ) type thing
that uses the names of the arguments of business object methods to
guess what sort of gui to draw for the user ....

Many thanks

Tom

Tom Counsell wrote:

Hello

Moin!

Is there a way to dynamically find out the names of a method's
arguments ?

From inside the method you could use local_variables at the very beginning of the method.

Many thanks
Tom

Regards,
Florian Gross