nodulator
Version:
Complete NodeJS Framework for Restfull APIs
29 lines (20 loc) • 708 B
text/coffeescript
Base = (name, injects) ->
class _Base
_name: name
_injects: injects
constructor: ->
if not name?
return console.error 'N.Base must have a name'
for arg, i in when typeof(arg) is 'string'
service = arg.slice 0, arg.search /Service$/g
if not (service in (key for key, val of Nodulator.services)) and service in _resources
Nodulator.ResourceService(service).Init()
return [, .concat [(args...) => .apply @, [args]]]
_Body: (args) ->
for arg, i in args when typeof([i]) is 'string'
@[[i]] = arg
if ?
@
: ->
thus = @
new thus