Hello,
Ok, trying with a module (instead of a class):
methods work,
BUT @vars and @@vars (accessed from the methods defined in the module) aren't accessible?!
=> Is there another way for
class Ext1 ... end
class Ext2 ... end
Hello,
Ok, trying with a module (instead of a class):
methods work,
BUT @vars and @@vars (accessed from the methods defined in the module)
aren't accessible?!
are you sure? (did you try?)
=> Is there another way for
class Ext1 ... end
class Ext2 ... end
class A < Ext1 end
AND
class A < Ext2 end
As I already explained, that doesn't work.
And (again), not a single line of your example "code"
is valid Ruby syntax.
Please
1. explain what you want to achieve (an actual use case)
2. provide a minimal *working* code example that demonstrates
what you already tried, and in what way it doesn't do what
you expect or need
Hello,
Ok, trying with a module (instead of a class):
methods work,
BUT @vars and @@vars (accessed from the methods defined in the module)
aren't accessible?!
are you sure? (did you try?)
Yes, I got nil instead the values I set (vars in the module!).
=> Is there another way for
class Ext1 ... end
class Ext2 ... end
class A < Ext1 end
AND
class A < Ext2 end
As I already explained, that doesn't work.
And (again), not a single line of your example "code"
is valid Ruby syntax.
I know, therefore the heading was "I want", "How can I achive" "Is there a way for..."
- that was the description what I want. (It wouldn't be a question if that worked
Hello,
Ok, trying with a module (instead of a class):
methods work,
BUT @vars and @@vars (accessed from the methods defined in the module)
aren't accessible?!
are you sure? (did you try?)
Yes, I got nil instead the values I set (vars in the module!).
?!?
(not very helpful)
It works for me... please provide some actual code you tried!
(Or we can go on forever with "it doesn't work" - "it should" -
"but it didn't" - "it did for me" - ... you get the picture.)
**Again:**
1. explain what you want to achieve (an actual use case)
2. provide a minimal *working* code example that demonstrates
what you already tried, and in what way it doesn't do what
you expect or need
And please, provide more *context*.
Your posts often seem like asking "how can I use a screwdriver
to get a nail in a piece of wood", while, if you would provide
some context, someone could point out to you that using a
hammer would be much better. Well, the example is not too good,
but I hope you get the point:
Don't ask how you can inherit from two classes (you can't),
but explain what you actually want to do, and someone can most
probably come up with the "Ruby way" to do it.
=> Is there another way for
class Ext1 ... end
class Ext2 ... end
class A < Ext1 end
AND
class A < Ext2 end
Possibly using modules. Maybe not.
That's the best I can come up with, regarding the lack of information.