Skip to content

Instantly share code, notes, and snippets.

@taq
Created January 18, 2009 19:06
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save taq/48743 to your computer and use it in GitHub Desktop.
Save taq/48743 to your computer and use it in GitHub Desktop.
class Test
class << self
attr_accessor :count
end
@count = 0
def initialize
self.class.count += 1
end
end
5.times do
Test.new
puts "#{Test.count} Test classes created."
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment