/ cloudformation-templates / node_modules / aws-cdk / node_modules / xmlbuilder / lib / XMLAttribute.js
XMLAttribute.js
1 // Generated by CoffeeScript 1.12.7 2 (function() { 3 var XMLAttribute; 4 5 module.exports = XMLAttribute = (function() { 6 function XMLAttribute(parent, name, value) { 7 this.options = parent.options; 8 this.stringify = parent.stringify; 9 if (name == null) { 10 throw new Error("Missing attribute name of element " + parent.name); 11 } 12 if (value == null) { 13 throw new Error("Missing attribute value for attribute " + name + " of element " + parent.name); 14 } 15 this.name = this.stringify.attName(name); 16 this.value = this.stringify.attValue(value); 17 } 18 19 XMLAttribute.prototype.clone = function() { 20 return Object.create(this); 21 }; 22 23 XMLAttribute.prototype.toString = function(options) { 24 return this.options.writer.set(options).attribute(this); 25 }; 26 27 return XMLAttribute; 28 29 })(); 30 31 }).call(this);