1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 | module.exports.target = (pending, specLocation) ->
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 | module.exports.render = (entity) ->
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 | body = """
|
25 |
|
26 | lastInstance = undefined
|
27 | module.exports = ->
|
28 |
|
29 | lastInstance = local =
|
30 |
|
31 | """
|
32 |
|
33 | body += "\n #{functionName}: ->\n" for functionName of entity.functions
|
34 | body += "\n return api ="
|
35 | body += "\n #{functionName}: local.#{functionName}\n" for functionName of entity.functions
|
36 | body += """
|
37 |
|
38 | module.exports._test = -> lastInstance
|
39 |
|
40 | """
|
41 |
|
42 | return body
|