1 | # coffeescript-module
|
2 |
|
3 | A base little class for your Coffeescript projects.
|
4 |
|
5 | ```
|
6 | npm install coffeescript-module
|
7 | ```
|
8 |
|
9 | ## Examples
|
10 |
|
11 | ``` coffeescript
|
12 | {Module} = require 'coffeescript-module'
|
13 |
|
14 | class Foo extends Module
|
15 | log: -> console.log 'hi!'
|
16 |
|
17 | class Bar extends Module
|
18 | @delegate 'log', Foo
|
19 | @aliasFunction 'b', 'a'
|
20 | @aliasProperty 'd', 'c'
|
21 |
|
22 | c: 'test'
|
23 | a: -> console.log 'a'
|
24 |
|
25 | class Baz extends Module
|
26 | @includes Bar
|
27 |
|
28 | bar = new Bar()
|
29 | bar.log() # calls Foo::log()
|
30 | bar.b() # calls Bar::a()
|
31 | bar.d # gets Bar::c
|
32 |
|
33 | baz = new Baz()
|
34 | baz.b() # calls Bar::a()
|
35 | ```
|
36 |
|
37 | ## Contributing
|
38 |
|
39 | If you have a useful addition or a bug fix, send a pull request!
|
40 |
|
41 | ## TODO
|
42 |
|
43 | * Write tests |
\ | No newline at end of file |