lib/service.js
function Service(options) {
  if (!(this instanceof Service)) {
    return new Service(options);
  }

  options = options || {};

  debug('New Service: %j', options);

  // There's no reasonable way to protect this, so we let it be writable with
  // the understanding that .update is called in the future. TL;DR - Write at
  // your own risk.
  this.data = clone(options.data || {});
  this._dataHash = sigmund(this.data);

  this._initProperties(options);

  assert(this.name, 'Name is required.');
}
function Service(options) {
  if (!(this instanceof Service)) {
    return new Service(options);
  }

  options = options || {};

  debug('New Service: %j', options);

  // There's no reasonable way to protect this, so we let it be writable with
  // the understanding that .update is called in the future. TL;DR - Write at
  // your own risk.
  this.data = clone(options.data || {});
  this._dataHash = sigmund(this.data);

  this._initProperties(options);

  assert(this.name, 'Name is required.');
}
function Service ( options ) { if ( ! ( this instanceof Service ) ) { return new Service ( options ) ; } options = options || { } ; debug ( 'New Service: %j' , options ) ; // There's no reasonable way to protect this, so we let it be writable with // the understanding that .update is called in the future. TL;DR - Write at // your own risk. this . data = clone ( options . data || { } ) ; this . _dataHash = sigmund ( this . data ) ; this . _initProperties ( options ) ; assert ( this . name , 'Name is required.' ) ; }
Creates a new instance of Service with the provided `options`.

A Service is a simple wrapper around its `data` to ease managing the
Service's representation within its Registry and the announcements thereof.

For more information, see the README.

@param {Object} options
Creates a new instance of Service with the provided options .