Say there are three classes: A
, B
& C
. I want each class to have a class method, say self.foo
, that has exactly the same code for A
, B
& C
.
Is it possible to define self.foo
in a module and include this module in A
, B
& C
? I tried to do so and got an error message saying that foo
is not recognized.
class
ofClass
orModule
. – Andrew Grimm