[Review]DoubleX RMVXA Object Trace

Purpose
Traces all objects belonging to a queried class linked to a queried object
Designed as a bug diagnosis tool used by scripters with debug experience

Configurations
  1.    #--------------------------------------------------------------------------|
  2.     #  Object Trace Condition Method                                           |
  3.     #  - Setups cond used by trace_obj(cond, label)                            |
  4.     #--------------------------------------------------------------------------|
  5.     # cond must be the symbol of a method taking the currently traced object as
  6.     # the only arguement
  7.     # The below examples are added to help you setup your own cond methods
  8.  
  9.     # Checks if the currently traced object belongs to klass
  10.     def self.cond_klass(obj)
  11.         obj.is_a?(klass)
  12.     end # cond_klass
  13.  
  14.     # Add your own cond methods here
  15.    
  16.  
  17.     #--------------------------------------------------------------------------|
  18.     #  Object Trace Label Method                                               |
  19.     #  - Setups label used by trace_obj(cond, label)                           |
  20.     #--------------------------------------------------------------------------|
  21.     # label must be the symbol of a method taking the currently traced object as
  22.     # the only arguement
  23.     # The below examples are added to help you setup your own label methods
  24.  
  25.     # Labels all traced objects using their class symbol
  26.     def self.label_klass(obj)
  27.         :"#{obj.class}"
  28.     end # label_klass
  29.  
  30.     # Add your own label methods here
  31.    
Expand to see the code.


Script Calls
  1. #  * Object manipulations                                                      |
  2. #    1. trace_obj(cond, label)                                                 |
  3. #       - Traces all objects meeting cond method linked to this object         |
  4. #       - Labels all traced objects using label method                         |
  5. #       - cond and label are method symbols in Object Trace Condition Method   |
  6. #         and Object Trace Label Method respectively                           |
  7. #    2. obj_trace[cond]                                                        |
  8. #       - Returns all traced objects meeting cond method linked to this object |
  9. #       - cond is a method symbol in Object Trace Condition Method             |
  10. #    3. (v1.01a+)trace_idef                                                    |
  11. #       - Traces all instance methods linked to this object                    |
  12. #    4. (v1.01a+)idef_trace                                                    |
  13. #       - Returns the trace of all instance methods linked to this object      |
Expand to see the code.


Games Using This Script
None so far

Prerequisites
Abilities:
1. Basic knowledge of inspecting objects in Ruby
2. Some RGSS3 scripting proficiency to fully utilize this script

Terms Of Use
You shall keep this script's Script Info part's contents intact
You shalln't claim that this script is written by anyone other than DoubleX or his aliases
None of the above applies to DoubleX or his aliases

Instructions
1. Open the script editor and put this script into an open slot between Materials and Main, save to take effect.

Authors
DoubleX

Changelog
  1. #    v1.02a(GMT 0100 27-10-2015):                                              |
  2. #    1. Lets uers set the conditions and labels for tracing objects            |
  3. #    v1.01b(GMT 1300 13-7-2015):                                               |
  4. #    1. Fixed not tracing klass linked to klass linked to queried object bug   |
  5. #    2. Fixed some Script Call Info and Implementation documentation typos     |
  6. #    3. Added more info in Prerequisites and Script Call Info                  |
  7. #    4. Increased this script's compactness                                    |
  8. #    v1.01a(GMT 1300 6-7-2015):                                                |
  9. #    1. Instance methods can be traced as well                                 |
  10. #    2. Increased this script's compactness and readability                    |
  11. #    v1.00b(GMT 0800 1-7-2015):                                                |
  12. #    1. Fixed object having Range and/or Structs not tracing klass properly bug|
  13. #    v1.00a(GMT 1200 27-6-2015):                                               |
  14. #    1. 1st version of this script finished                                    |
Expand to see the code.


Download Link
http://pastebin.com/pySjrKvh

Original thread: https://www.hbgames.org/forums/viewtopic.php?t=78860