Skip to content

Instantly share code, notes, and snippets.

@alexspeller
Created August 11, 2013 16:55
Show Gist options
  • Save alexspeller/6205726 to your computer and use it in GitHub Desktop.
Save alexspeller/6205726 to your computer and use it in GitHub Desktop.
# 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