Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added Base#delegateTo

  • Loading branch information...
commit 7c8d6d15541e1d821dfefc4f46e8c43926f1ff15 1 parent 130dfa1
@markevans authored
Showing with 8 additions and 0 deletions.
  1. +8 −0 src/base.coffee
View
8 src/base.coffee
@@ -36,6 +36,14 @@ class egg.Base
else
[@]
)
+
+ @delegateTo: (ownMethod, methods)->
+ for method in methods
+ (=>
+ meth = method
+ @::[meth] = (args...)->
+ @[ownMethod]()[meth](args...)
+ )()
@create: (opts={})->
new @(opts)
Please sign in to comment.
Something went wrong with that request. Please try again.