-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmethod.js
48 lines (48 loc) · 998 Bytes
/
method.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
module.exports = {
name: "method",
ns: "utils",
description: "Execute a method",
phrases: {
active: "Executing method {{input.method}}"
},
ports: {
input: {
"in": {
type: "array",
title: "Arguments",
description: "arguments to be applied to this method",
"default": []
},
instance: {
type: "function",
title: "Instance",
description: "instance to invoke this method on"
},
method: {
type: "string",
title: "Method name"
}
},
output: {
out: {
title: "Out",
type: "any"
},
error: {
title: "Error",
type: "object"
}
}
},
fn: function method(input, $, output, state, done, cb, on) {
var r = function() {
output.out = $.write('in', $.instance[$.method].apply($.instance, $.in))
}.call(this);
return {
output: output,
state: state,
on: on,
return: r
};
}
}