Created
August 11, 2013 16:55
-
-
Save alexspeller/6205726 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
| # Create a new class A with instance method a | |
| A = Em.Object.extend | |
| a: -> 1 | |
| # Create a new class B with instance method b | |
| B = Em.Object.extend | |
| b: -> 2 | |
| # Create a new class C with instance methods b & c | |
| C = B.extend | |
| c: -> 3 | |
| # Add a new method to C called d | |
| C.reopen | |
| d: -> 4 | |
| # Add a class method to c, that you can call with c.e() | |
| C.reopenClass | |
| e: -> 5 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment