Skip to content

Instantly share code, notes, and snippets.

@jshawl
Created March 25, 2015 01:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save jshawl/2f0ed86f6ed6a103d917 to your computer and use it in GitHub Desktop.
Save jshawl/2f0ed86f6ed6a103d917 to your computer and use it in GitHub Desktop.
class Apartment
@@all = []
def initialize
@@all << self
end
def self.count
@@all.length
end
end
Apartment.new
Apartment.new
Apartment.new
p Apartment.count
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment