Ticket #11 (closed defect: fixed)
ComposedObject::def_traits installs trait methods in ComposedObject instead of the calling class
| Reported by: | ged | Owned by: | ged |
|---|---|---|---|
| Priority: | normal | Milestone: | ActualityEpic |
| Component: | GameWorld | Version: | 1.0 |
| Severity: | normal | Keywords: | traits composed object character |
| Cc: |
Description
I noticed that the trait methods defined in the character actually show up in ComposedObject?, which has the end result that every class derived from ComposedObject? shares its traits with every other one. This, of course, is bad.
I've written a little test script (in source:trunk/experiments/where-do-traits-inhere.rb) whose output is:
[pts/ttyp4] 63/538 {0}$ ruby experiments/where-do-traits-inhere.rb
Trying FaerieMUD::Character.instance_methods(false) & traits...
---------------------------------------------------------------------------
[]
---------------------------------------------------------------------------
Trying FaerieMUD::ComposedObject.instance_methods(false) & traits...
---------------------------------------------------------------------------
["strength", "magistry", "grace", "dexterity"]
---------------------------------------------------------------------------
When this is fixed, they should show up in the top section instead of the bottom one.
