Skip to content

Commit

Permalink
Give Service a *shortName* property.
Browse files Browse the repository at this point in the history
Issue #130.

␄
  • Loading branch information
Mike Castle committed Oct 25, 2023
1 parent 92cd237 commit bc7a662
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions linkedin-tool.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -1583,17 +1583,24 @@
return this.#name;
}

/** @type {string} - Shorter instance name. */
get shortName() {
return this.#shortName;
}

/** @param {string} name - Custom portion of this instance. */
constructor(name) {
if (new.target === Service) {
throw new TypeError('Abstract class; do not instantiate directly.');
}
this.#name = `${this.constructor.name}: ${name}`;
this.#shortName = name;
this.#logger = new NH.base.Logger(this.#name);
}

#logger
#name
#shortName

/** @param {string} name - Name of method that was not implemented. */
#notImplemented(name) {
Expand Down

0 comments on commit bc7a662

Please sign in to comment.