Created
          September 26, 2008 20:12 
        
      - 
      
- 
        Save nrk/13191 to your computer and use it in GitHub Desktop. 
  
    
      This file contains hidden or 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
    
  
  
    
  | all_foos = [] | |
| class Foo | |
| def initialize(foos) | |
| foos << self | |
| end | |
| end | |
| p all_foos # => [] | |
| Foo.new all_foos | |
| Foo.new all_foos | |
| p all_foos # => [#<Foo:0x2c8731c>, #<Foo:0x2c87308>] | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment