Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save aviflombaum/637bf8a96ff017f33518 to your computer and use it in GitHub Desktop.
Save aviflombaum/637bf8a96ff017f33518 to your computer and use it in GitHub Desktop.
class School
@@school_hash = {}
@@school_count = 0
def initialize(school, location, ranking)
@school = school
@@school_hash[:school] = school
@@school_count += 1
end
def self.all
@@school_hash
end
def self.count
@@school_count
end
def self.reset_all = (0)
@@school_count = 0
# Though I imagine you should also reset @@school_hash
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment