Q: I have a class in a random module/namespace that I can get hold of an instance off, and call .class on. Is there any way to extend that class in a separate/module namespace, as if the original class was evaled in the other module? Just doing class Foo < bar.class doesn't work for some reason
ljarvis: that would have the same effect as Foo < bar.class? What I'm seeing there is that attributes of the base Bar class, eg url "http:/..." do not seem to have any effect on the subclass, as if they were not set
ljarvis: i assume most maintainers are maintaining the canoical brew formula for a software packge, so there they don't have that issue. brew supports pinning other taps, so i can provide an alternate formula for an existing packge, but i'd have to provide the full package, making mine stale quite fast, which is why i'd rather inherit the existing formula and just add my tweak, so i can pick up any changes to the software
to put it another way, i want to extend install() and caveats(), but still call the base implementation, either though super or some other magic trick that achieves the same :)
matthewd:hmm, both extend and include assumes the module has naked functions as far as i understood it? so if I have module X; class Foo; end; end, can i then include/prepend the methods and attributes etc of Foo into a new class Bar?
Q: I'm using method(__method__).parameters.each do |type, k| to instance_variable_set() named initialize() parameters, and it works fine in a regular class. But when I move the initialize code to a module, and call super from the class, the parameters are passed, but instance_variable_set doesn't seem to have any effect. Is there any way for the module's initialize() to affect instance variables of the class it's been included in? Thanks!