Ruby - Class Methods and Variables
What will be the output of this Ruby code?
class Dog
@@count = 0
def initialize
@@count += 1
end
def self.count
@@count
end
end
Dog.new
Dog.new
puts Dog.count