Open k3rni opened 10 years ago
I looked into this and it seems related to the fact that attribute_set
is class scope. Changing attribute_set
to instance scope seems fraught with backwards incompatibilities. @solnic do you have any thoughts about how this issue might be fixed in a backwards compatible way?
Sorry but this will not be fixed. It's a mis-use of the library. Should be documented. Maybe we could tackle this in 2.0 if somebody can find a simple way to support this. Personally I would advocate against such a mix.
Cool, thanks for the clarification.
Fair enough, though it's a bit disappointing to have to use the attribute
syntax instead of a single extend
with a module definition. Needs to be documented somewhere next to 'Dynamically extending instances'.
@k3rni - can you come up with some example language that would have clarified the issue for you? I am happy to add it to the README.
The puts marked with "(2)" should print out
{:one => "13", :two => 123}
, but this is not the case, as it only prints{:two => 123}
. However, the attributes are still accessible, as shown by "(3)" and "(4)".