Skip to content

Instantly share code, notes, and snippets.

@gr33n7007h
Created July 11, 2016 00:57
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 gr33n7007h/d6bacb1fa444ba4a78fd28151a20eca1 to your computer and use it in GitHub Desktop.
Save gr33n7007h/d6bacb1fa444ba4a78fd28151a20eca1 to your computer and use it in GitHub Desktop.
populate
#!/usr/bin/env ruby
class NamesList
@names = []
def self.populate
@names
end
def populate
self.class.populate
end
end
NamesList.populate << "foo"
NamesList.populate << "bar"
n = NamesList.new
n.populate << "FOO"
n.populate << "BAR"
p NamesList.populate
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment