Skip to content

Instantly share code, notes, and snippets.

@kbberker
Created November 27, 2018 10:17
Show Gist options
  • Save kbberker/8e2c1459261f56586b4a755de8bcafd5 to your computer and use it in GitHub Desktop.
Save kbberker/8e2c1459261f56586b4a755de8bcafd5 to your computer and use it in GitHub Desktop.
class VideoGameCharacter
@@all = []
def initialize(name, level)
@name = name
@level = level
@@all << self
end
def level_up
self.level += 1
end
def self.all
@@all
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment