Skip to content

Instantly share code, notes, and snippets.

@cjavdev
Created June 25, 2013 03:44
Show Gist options
  • Save cjavdev/5855769 to your computer and use it in GitHub Desktop.
Save cjavdev/5855769 to your computer and use it in GitHub Desktop.
class Tracker
@tracked_items = []
def initialize
Tracker.tracked_items << self
end
def self.tracked_items
@tracked_items
end
end
class Tracked < Tracker
def initialize
super
end
end
x = Tracked.new
y = Tracked.new
p Tracker.tracked_items
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment