Sure but variable references and dictionary attributes are not directly linked.
(In fact all dictionary attributes are stored as string text.)
So YOU need to make the link.
-
Remove all
'@'
from the dictionary names, and leave the'@'
prefixes on the Ruby instance variable names. -
Change the
"_innerDiameter_label"
to just"Inner Diameter"
(the user should not need to know what the actual variable / attribute reference names are.) -
Use a class constant to reference the dynamic attributes dictionary name, rather than creating a bunch of identical literal string objects:
DYNDICT = 'dynamic_attributes'
- Then in your
setAttributes()
method:
theDef.set_attribute( DYNDICT, 'innerDiameter', @innerDiameter )