Based on your description it seems unclear as to why you'd want to use inheritance here when the goal is to simply store the weights associated with the vector. I can envision either a class with a .vector and .weight attribute and some supporting methods. Here are some examples of what I think would be cleaner implementations of your idea.
class MyClass
attr_accessor ;weight
def initialize(x,y,z,weight)
@vector = Geom;;Vector3d.new(x,y,z)
@weight = weight
end
def vector
return @vector.transform(@weight)
end
end
This would cleanly differentiate between the underlying Vector3d and the weight you want to store and allows you to update the weight while encapsulating the scaling behavior in the .vector method. The only downside of this approach is that occasionally you'll have to type my_class.vector.method instead of my_class.method but it avoids the semantic muddling of the underlying vector defined by the x,y,z values provided to initialize and the weighted version of it.