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