forked from Ermlab/nxt-gitlab
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBaseModel.coffee
More file actions
30 lines (24 loc) · 1.14 KB
/
BaseModel.coffee
File metadata and controls
30 lines (24 loc) · 1.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
debug = require('debug') 'gitlab:BaseModel'
class module.exports
constructor: (@client) ->
do @_init
load: (model) =>
switch model
when "Groups" then require("./Models/Groups") @client
when "Issues" then require("./Models/Issues") @client
when "ProjectDeployKeys" then require("./Models/ProjectDeployKeys") @client
when "ProjectHooks" then require("./Models/ProjectHooks") @client
when "ProjectIssues" then require("./Models/ProjectIssues") @client
when "ProjectMembers" then require("./Models/ProjectMembers") @client
when "ProjectMergeRequests" then require("./Models/ProjectMergeRequests") @client
when "ProjectMilestones" then require("./Models/ProjectMilestones") @client
when "ProjectRepository" then require("./Models/ProjectRepository") @client
when "Projects" then require("./Models/Projects") @client
when "Users" then require("./Models/Users") @client
_init: =>
@debug = require('debug') "gitlab:Models:#{@constructor.name}"
@get = @client.get
@post = @client.post
@put = @client.put
@delete = @client.delete
do @init if @init?