Skip to content
This repository has been archived by the owner on Jan 6, 2025. It is now read-only.

Commit

Permalink
feat(attribute.js): add static of method
Browse files Browse the repository at this point in the history
  • Loading branch information
stfsy committed Mar 27, 2017
1 parent cd5f3f8 commit 498aee6
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion lib/attribute.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,22 @@
*/
class Attribute {

/**
* Wrap an Attribute to get access to utility functions
* @param {String} [key=undefined] key key of the attribute
* @param {String} [value=undefined] value value of the attribute
* @returns {Attribute} a new Attribute
*/
static of(key, value) {

return new Attribute(key, value)
}

/**
* @constructor
* @param {string} key attributes key
* @private
* @description <b>Do not use this method directly. Use one of the static helper methods instead.</b
* @param {string} [key=undefined] key attributes key
* @param {string} [value=undefined] value attributes value
* @returns {Attribute} a new Attribute
*/
Expand Down

0 comments on commit 498aee6

Please sign in to comment.