0.5.0 • Published 11 years ago

coffee_classkit v0.5.0

Weekly downloads
2
License
-
Repository
github
Last release
11 years ago

CoffeeClasskit

You can make much more with CoffeeScript classes.

Why

As of extends is implemented in coffee with

for key of parent
  child[key] = parent[key]  if __hasProp_.call(parent, key)

it makes absolutely impossible to define class instance variables.

Solution

With classkit.extendsWithProp default inheritance is redefined using child.__proto__ = parent. So it would not work on engines which do not support __proto__.

Ensure that you call this method before any class properties declaraction, 'cause it'll drop'em all.

Once you use extendsWithProto you should use it on all descendents.

More

Here is also helpers to define ruby-like instance & class variables.

Instance variables usage requires extendsWithProto.

Examples

See tests for examples.

License

BSD

0.5.0

11 years ago

0.4.2

11 years ago

0.4.1

11 years ago

0.4.0

11 years ago

0.3.0

11 years ago

0.2.0

11 years ago

0.0.1

11 years ago