#!/usr/bin/ruby
class TestClass
@@count = 0
def initialize
@@count+=1
end
def show
puts "#{@@count}"
end
end
a = TestClass.new
a.show
b = TestClass.new
b.show
Ruby Справочник v0.05 © 2007-2024 Igor Salnikov aka SunDoctor