class Test
class << self
attr_accessor :foo
end
self.foo = 0
def initialize
self.class.foo += 1
end
end
4.times{ Test.new }
p Test.foo == 4
Y2xhc3MgVGVzdAogIGNsYXNzIDw8IHNlbGYKICAgIGF0dHJfYWNjZXNzb3IgOmZvbwogIGVuZAogIHNlbGYuZm9vID0gMAoKICBkZWYgaW5pdGlhbGl6ZQogICAgc2VsZi5jbGFzcy5mb28gKz0gMQogIGVuZAplbmQKCjQudGltZXN7IFRlc3QubmV3IH0KCnAgVGVzdC5mb28gPT0gNA==