From: Kyle Heon Date: 2005-07-10T21:09:41+09:00 Subject: Re: Reflection of an unloaded class/object I want to build a navigation system for my Rails app that using techniques found in these articles: http://wiki.rubyonrails.com/rails/show/HowToMakeSitemapWithIntrospection http://wiki.rubyonrails.com/rails/show/DiscoveringControllersAndActions My problem with those solutions is that it seems awfully wasteful to "load" each controller just so that it's visible to the ObjectSpace object. My understanding is at that point it's loaded, is this an incorrect assumption? In C# you can use Reflection by pointing to an assembly (dll) and I'm curious if Ruby has something similar. So, taking something from the above options here is some really rough psuedo code: Find.find( RAILS_ROOT + 'app/controllers' ) do |file_name| open file-_name if of type Admin::BaseController add to controllers array end loop controllers array output found controllers. If I'm going about this completely wrong and you know how I can do this better by all means, let me know. As I said, I'm learning Ruby and I'm just trying to learn how to do stuff. I would imagine I'm not doing things the best way possible. Kyle Heon kheon@comcast.net -----Original Message----- From: Robert Klemme [mailto:bob.news@gmx.net] Sent: Sunday, July 10, 2005 6:11 AM To: ruby-talk ML Subject: Re: Reflection of an unloaded class/object "Kyle Heon" schrieb im Newsbeitrag news:20050710012201.63AE733A20@beryllium.ruby-lang.org... > Is it possible to look inside an object without it having already been > loaded into memory? In other words, can you do so by file path instead > of having it look at what is currently loaded? What exactly do you mean by "look inside an object"? What is it that you are trying to achieve? Kind regards robert