Skip to content

Instantly share code, notes, and snippets.

@assertchris
Created May 2, 2012 13:12
Show Gist options
  • Select an option

  • Save assertchris/2576449 to your computer and use it in GitHub Desktop.

Select an option

Save assertchris/2576449 to your computer and use it in GitHub Desktop.
Function::implements = (argv...) ->
for proto in argv
for key, value of proto::
@::[key] = value
@
class Animal
hello: (what) ->
alert(what)
class Organic
foo: (what) ->
alert(what)
class Snake extends Animal
@implements Organic
options:
"foo": "bar"
"hello": "world"
constructor: (hello, foo) ->
@hello(hello)
@foo(foo)
new Snake("world", "bar");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment