Initialize a new `Resource`.

@param {Object} spec
@param {Object} options
@api public
199939
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 = {};
}
1180941
function config(options) {
    var current = config.current
    Object.assign(current, options)
    api._init(current)
}
472338
protected void initQueue(T queue, QueueSpec spec) throws Exception {
        queue.setObserver(defaultObserver);
        queue.init();
    }
347301
function Operation(spec, options, fn) {
  if (typeof options === 'function') {
    fn = [].slice.call(arguments).slice(1);
    options = {};
  } else if (Array.isArray(options)) {
    fn = options;
    options = {};
  } else if (!Array.isArray(fn)) {
    fn = [].slice.call(arguments).slice(2);
  }

  if (!(this instanceof Operation)) {
    return new Operation(spec, options, fn);
  }

  if (typeof spec !== 'object') {
    throw new Error('operation spec must be an object');
  }

  debug('create operation', spec);

  this.spec = spec;
  this.options = options || {};
  this.fn = fn;
  this.middleware = {};
}
827388
function createOptionsForServerSpec(serverSpec) {
    var options = {
        forceNew: true,            // Make a new connection each time
        reconnection: false        // Don't try and reconnect automatically
    };

    // If the server spec contains a socketResource setting we use
    // that otherwise leave the default ('/socket.io/')
    if(serverSpec.socket.socketResource) {
        options.resource = serverSpec.socket.socketResource;
    }
    return options;
}
662891
function create (id, spec) {
  validateModifiers(id, spec, ['schema', 'options'])

  const entity = {}
  entity.spec = spec
  entity.schema = deepFreeze(_.defaultTo(spec.schema, {}))
  entity.options = deepFreeze(_.defaultTo(spec.options, {}))

  validateSchema(entity.schema, entity.options)
  return entity
}
1023860
function watcher (specs, options) {
  const err = fileOptions.validate(specs)
  if (err) {
    return Promise.reject(err)
  }
  const w = new Watcher(fileOptions.normalize(specs), options || {})
  return w._promise.then(() => w)
}
271274
function(description, body) {
          var spec = new JSpec.Spec(description, body)
          this.specs.push(spec)
          JSpec.stats.specs++ // TODO: abstract
          spec.suite = this
        }
993425
function QuestionsStore(options) {
  debug('initializing from <%s>', __filename);
  Cache.call(this, options);
  this.createStores(this, this.options);
  this.listen(this);
}
497695
function( options ) {
  this.options = options;
  this.wpt = new WPT( this.options.wpt.server );

  this.data  = [];
  this.queue = new Queue();
}
979279
function create (id, spec) {
  // create an entity instance
  const entity = new RenderTemplate()
  entity.spec = spec
  // set/create template from spec.template value
  entity.template = _.template(_.defaultTo(spec.template, ''))
  return entity
}
37039
function Watcher (specs, options) {
  const self = this
  EventEmitter.call(this)

  this._options = {
    dest: options.dest || 'target',
    dir: options.dir || '.'
  }

  this._promise = Promise.all(specs)
    .filter((spec) => spec && spec.watch)
    .map((spec) => specToWatcherObj(self, spec, self._options))
    .then((watchers) => {
      self._watchers = watchers
    })
}
1249450
function Resource( pkg, config ) {
	var key;

	// Properties
	this.pkg = pkg;
	this.config = {};

	// Initialization
	for ( key in config ) {
		if ( Object.prototype.hasOwnProperty.call( config, key ) ) {
			this.config[key] = config[key];
		}
	}
}
1066789
function(options) {
      var t = this;
      t.options = options;
      t.monitor = options.monitor;

      // Call this to set the initial height/width to something
      // other than the size of the inner view elements.
      options.component.setDefaultSize({
        width: 400,
        height: 300
      });

      // Set monitor defaults.  If your view is for a specific probe,
      // then set the probeClass and any default probe initialization
      // parameters.
      if (!t.monitor.get('probeClass')) {
        t.monitor.set({
          probeClass: '{{shortAppName}}SampleProbe'
        });
      }

      // Update the view on monitor change.  The monitor isn't in
      // a connected state, so this will be called when connected.
      if (t.monitor != null) {
        t.monitor.on('change', t.onchange, t);
      }
    }
647799
function(element, options) {
      options || (options = { });

      this.callSuper('initialize', options);
      this._initElement(element);
      this._originalImage = this.getElement();
      this._initConfig(options);

      this.filters = [ ];

      if (options.filters) {
        this.filters = options.filters;
        this.applyFilters();
      }
    }
536260
function initialize(server, callback) {
		source = new Backend(server, options);
		source.initialize(callback);
	}
874636
function (element, options) {
    this.element = $(element)
    this.options = $.extend(true, {}, this.options, options)
    this._init()
  }