Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Made everyModule.routes a getter (was a method).

  • Loading branch information...
commit 1cbf91b6076932d05ce8b1d365a6d4214fdbd0b4 1 parent 83d82cf
Brian Noguchi authored
Showing with 18 additions and 17 deletions.
  1. +18 −17 lib/everymodule.js
35 lib/everymodule.js
View
@@ -43,23 +43,6 @@ var everyModule = module.exports = {
}
, get: route('get')
, post: route('post')
- , routes: function () {
- var arr = []
- , _routes = this._routes
- , _descriptions = this._configurable
- , aliases
- , self = this;
- for (var method in _routes) {
- aliases = _routes[method]
- method = method.toUpperCase();
- arr = arr.concat( aliases.map( function (alias) {
- return method + ' (' + alias + ') [' +
- self[alias]() + ']' +
- _descriptions[alias].replace(routeDescPrefix[method], '');
- }) );
- }
- return arr;
- }
, configurable: function (arg, description) {
if (!arguments.length)
return this._configurable;
@@ -208,6 +191,24 @@ var everyModule = module.exports = {
, _configurable: {}
};
+Object.defineProperty(everyModule, 'routes', {get: function () {
+ var arr = []
+ , _routes = this._routes
+ , _descriptions = this._configurable
+ , aliases
+ , self = this;
+ for (var method in _routes) {
+ aliases = _routes[method]
+ method = method.toUpperCase();
+ arr = arr.concat( aliases.map( function (alias) {
+ return method + ' (' + alias + ') [' +
+ self[alias]() + ']' +
+ _descriptions[alias].replace(routeDescPrefix[method], '');
+ }) );
+ }
+ return arr;
+}});
+
everyModule.configurable('init User');
everyModule
Please sign in to comment.
Something went wrong with that request. Please try again.