forward.coffee | |
---|---|
Forward method calls to certain properties.
same as
@object {String} the name of the property to forward calls to @methods {Strings...} the methods to be wired @api public | forward = (property, methods...) ->
proto = @::
for method in methods
do (method) ->
proto[method] = -> @[property][method].apply @[property], arguments
exports.forward = forward
|