From: Dave Thomas Date: 2001-05-10T14:03:37+09:00 Subject: [ruby-talk:14935] Re: Class/Module Information matz@zetabits.com (Yukihiro Matsumoto) writes: > So there're three separate (but related) possible RCRs: > > Module#included_modules(includeIndirect=true) > Module#constants(includeSuper=true) > Module#class_variables(includeSuper=true) Before we go too far down this road, is it possible that there's another way of doing this altogether? Say we had Object#reflection, which returned an object of type ObjectReflector. This could provide all the various introspection methods in one tidy place ObjectReflector#own_instance_methods all_instance_methods singleton_methods own_instance_variables all_instance_variables : : and so on. This would work for classes and modules too. Then we could also have Method#reflection -> MethodReflector, which could give us MethodReflector#arity #number_of_required_args #has_optional_arg? #has_block_arg? : : and so on. This seems tidier to me, and sets a precedent should we ever allow other forms of reflection. Dave