reflection.rb

Path: lib/more/facets/reflection.rb
Last Update: Mon Mar 16 08:45:52 -0400 2009

Reflection

Provides externailzed, safe access to an object‘s meta-information.

Authors

  • Thomas Sawyer

Copying

Copyright (c) 2006 Thomas Sawyer

Ruby License

This module is free software. You may use, modify, and/or redistribute this software under the same terms as Ruby.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

NOTES

This is expirmental. Maybe it should be moved to the Trinkets project. The idea is to be able to access a object as a pure object, by binding methods called to Object/Kernel first. Thus bypassing any overriden methods.

But you can use at to do this already.

  obj.at(Object).object_id

For metaprogramming this can be important.

[Validate]