hairyhenderson/jiraprinter

View on GitHub
routes/issuetype_router.js

Summary

Maintainability
B
6 hrs
Test Coverage
var IssueTypes = require('../lib/issuetypes')

function IssueTypeRouter (config, router) {
  this.config = config || {}
  this.router = router

  /* eslint-disable */
  var issuetypes = null
  Object.defineProperties(this, {
    issuetypes: {
      set: function (s) {
        issuetypes = s
      },
      get: function () {
        if (!issuetypes) {
          issuetypes = new IssueTypes(this.config)
        }
        return issuetypes
      }.bind(this)
    }
  })
/* eslint-enable */
}

IssueTypeRouter.prototype.routes = function () {
  this.router.get('/', this.issuetypes.get.bind(this.issuetypes))
  return this.router
}

module.exports = IssueTypeRouter