Skip to content

Instantly share code, notes, and snippets.

@thomasmarren
Created October 17, 2016 13:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thomasmarren/6a71b79c4a759d6d96c61d9bb7a8b031 to your computer and use it in GitHub Desktop.
Save thomasmarren/6a71b79c4a759d6d96c61d9bb7a8b031 to your computer and use it in GitHub Desktop.
#Ruby
class User
def initialize (id = nil, name, grade)
self.name = name
self.grade = grade
@@all << self
end
def self.all
@all
end
end
User.all
#Active Record
users = User.all
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment