Created
          August 5, 2010 22:14 
        
      - 
      
- 
        Save ymendel/510486 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
    
  
  
    
  | class Foo | |
| class << self | |
| def some_method | |
| Bar.some_method | |
| end | |
| end | |
| end | |
| class Bar < Foo | |
| class << self | |
| def some_method | |
| # some awesome code here | |
| end | |
| end | |
| end | 
  
    
      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
    
  
  
    
  | class Foo | |
| class << self | |
| def new(arg) | |
| obj = Bar.allocate | |
| obj.send(:initialize, arg) | |
| obj | |
| end | |
| def method_missing(meth, *args) | |
| Bar.send(meth, *args) | |
| end | |
| end | |
| end | |
| class Bar < Foo | |
| # you know it | |
| end | 
  
    
      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
    
  
  
    
  | class Bar | |
| end | |
| Foo = Bar # aww yeah | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment