module M
def f=(x)
@f= x
end
def f
@f
end
end
class A
extend M
end
class B < A
end
A.f= 42
puts A.f
puts B.f
this produces
42
nil
Is @f a class variable to A and B? How do I share a variable between A and B by only writing this into M?