|
1 | 1 | [](https://travis-ci.org/CocktailJS/cocktail-trait-advisable) |
2 | | -[](http://badge.fury.io/js/cocktail-trait-advisable) |
| 2 | +[](http://badge.fury.io/js/cocktail-trait-advisable) |
3 | 3 |
|
4 | 4 | # cocktail-trait-advisable |
5 | 5 |
|
@@ -83,13 +83,16 @@ this will be called after! |
83 | 83 |
|
84 | 84 | The following methods will be publicly available on the host class: |
85 | 85 |
|
86 | | -- `after(methodName, adviceFunction)`: Adds the adviceFunction to be called after the method. |
| 86 | +- `after( methodName, adviceFunction, [scope] )`: Adds the adviceFunction to be called after the method. |
87 | 87 | - **methodName** {String}: The method name in the host class. |
88 | | - - **adviceFunction** {Function}: the function to be called. It receives the same parameters as the method. |
89 | | -- `before(methodName, adviceFunction)`: Adds the adviceFunction to be called before the method. |
| 88 | + - **adviceFunction** {String|Function}: the function or the name of the function to be called. It receives the same parameters as the method. |
| 89 | + - **scope** {Object} the scope to execute the adviceFunction. Optional. |
| 90 | +- `before( methodName, adviceFunction, [scope] )`: Adds the adviceFunction to be called before the method. |
90 | 91 | - **methodName** {String}: The method name in the host class. |
91 | | - - **adviceFunction** {Function}: the function to be called. It receives the same parameters as the method. |
92 | | -- `around(methodName, adviceFunction)`: Adds the adviceFunction to be called around the method. |
| 92 | + - **adviceFunction** {String|Function}: the function or the name of the function to be called. It receives the same parameters as the method. |
| 93 | + - **scope** {Object} the scope to execute the adviceFunction. Optional. |
| 94 | +- `around( methodName, adviceFunction, [scope] )`: Adds the adviceFunction to be called around the method. |
93 | 95 | - **methodName** {String}: The method name in the host class. |
94 | | - - **adviceFunction** {Function}: the function to be called. It receives the method as the first parameter and then same parameters. |
95 | | - |
| 96 | + - **adviceFunction** {String|Function}: the function or the name of the function to be called. It receives the method as the first parameter and then same parameters. |
| 97 | + - **scope** {Object} the scope to execute the adviceFunction. Optional. |
| 98 | + |
0 commit comments