Ruby - Class Methods and Variables
Identify the problem in this Ruby code using class variables:
class A
@@count = 0
def initialize
@@count += 1
end
def self.count
@@count
end
end
class B < A
def initialize
@@count += 10
end
end
A.new
B.new
puts A.count