use Ox.filter

This commit is contained in:
rolux 2012-05-25 19:46:27 +02:00
parent ec12eddfba
commit e1192fd45e

View file

@ -344,15 +344,15 @@ Ox.wrap = function(value, chained) {
return value; return value;
} }
}; };
Ox.methods(Ox).forEach(function(method) { Ox.methods(Ox).filter(function(method) {
if (method[0] == method[0].toLowerCase()) { return method[0] == method[0].toLowerCase();
wrapper[method] = function() { }).forEach(function(method) {
var args = Array.prototype.slice.call(arguments), ret; wrapper[method] = function() {
args.unshift(value); var args = Array.prototype.slice.call(arguments), ret;
ret = Ox[method].apply(Ox, args); args.unshift(value);
return wrapper.chained ? Ox.wrap(ret, true) : ret; ret = Ox[method].apply(Ox, args);
}; return wrapper.chained ? Ox.wrap(ret, true) : ret;
} };
}); });
return wrapper; return wrapper;
}; };