Permalink
Browse files

moved shortand http method helpers to Meryl prototype

  • Loading branch information...
1 parent 7194b33 commit 0a554f6ccd65987fee005235b9c3a06fa739d71d @kadirpekel committed Oct 22, 2010
Showing with 12 additions and 10 deletions.
  1. +12 −10 lib/meryl.js
View
@@ -49,15 +49,6 @@ var Meryl = function () {
// Options
this.options = {};
-
- // Shorthand meryl functions for http methods
- ['get', 'post', 'put', 'delete'].forEach(function (method) {
- self[method] = function () {
- var args = Array.prototype.slice.call(arguments);
- args[0] = method.toUpperCase() + ' ' + args[0];
- return self.plug.apply(self, args);
- };
- });
};
Meryl.prototype = {
@@ -381,9 +372,20 @@ Meryl.prototype = {
}
return contextCarrier.apply(self, arguments);
}
-};
+};
/*
+ * Shorthand meryl functions for http methods
+ */
+['get', 'post', 'put', 'delete'].forEach(function (method) {
+ Meryl.prototype[method] = function () {
+ var args = Array.prototype.slice.call(arguments);
+ args[0] = method.toUpperCase() + ' ' + args[0];
+ return this.plug.apply(this, args);
+ };
+});
+
+/*
* Handle uncaught exceptions explicitly to prevent node exiting
* current process. Exception stack trace is sent to stderr.
*/

0 comments on commit 0a554f6

Please sign in to comment.