code: function Resource(spec, options) {
    if (!(this instanceof Resource)) {
      return new Resource(spec, options);
    }
  
    if (typeof spec !== 'object') {
      throw new Error('resource spec must be an object');
    }
  
    debug('create resource %s', spec.path, spec);
  
    this.spec = spec;
    this.list = [];
    this.options = options || {};
  
    this.middleware = {};
    this.operations = {};
  }
docs: Initialize a new `Resource`.
  
  @param {Object} spec
  @param {Object} options
  @api public