Created
November 3, 2016 17:49
-
-
Save eggie5/21918365ba9bb2148d7d27c8540e6c13 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'singleton' | |
class World | |
include Singleton | |
attr_accessor :creatures | |
def initialize | |
self.creatures=[] | |
end | |
end | |
i=World.instance | |
i.creatures.push "Bulbasaur" | |
World.instance.creatures.push "Pickachu" | |
p i.creatures | |
# ["Bulbasaur", "Pickachu"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment