module M
  def x
    @x
  end
  def x= v
    @x = v
  end
end

class A; include M; end
class B; include M; end

a=A.new
b=B.new

a.x = 42
p a.x
p b.x
b.x = 'forty-two' 
p a.x
p b.x
