Skip to content

Commit

Permalink
feat(shape): Implements get and set of names from shape
Browse files Browse the repository at this point in the history
This feature allows to you make JSON represantion of each shape and know what is the shape in JSON
  • Loading branch information
ghaiklor committed Nov 19, 2015
1 parent 8bdc3b0 commit de587ef
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/shapes/Shape.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
* }
*/
export class Shape {
_name = 'Shape';
_text = '';
_width = 15;
_height = 5;
Expand Down Expand Up @@ -51,6 +52,27 @@ export class Shape {
this.setForeground(foreground);
}

/**
* Get name of shape.
* Base shape has `Shape` name.
*
* @returns {String}
*/
getName() {
return this._name;
}

/**
* Set new name to shape.
*
* @param {String} name New name of the shape
* @returns {Shape}
*/
setName(name) {
this._name = name;
return this;
}

/**
* Get text content from this shape.
*
Expand Down

0 comments on commit de587ef

Please sign in to comment.