artdaq_node_server  v1_00_08
 All Classes Namespaces Files Variables Pages
XMLAttribute.js
1 // Generated by CoffeeScript 1.9.1
2 (function() {
3  var XMLAttribute, create;
4 
5  create = require('lodash/create');
6 
7  module.exports = XMLAttribute = (function() {
8  function XMLAttribute(parent, name, value) {
9  this.stringify = parent.stringify;
10  if (name == null) {
11  throw new Error("Missing attribute name of element " + parent.name);
12  }
13  if (value == null) {
14  throw new Error("Missing attribute value for attribute " + name + " of element " + parent.name);
15  }
16  this.name = this.stringify.attName(name);
17  this.value = this.stringify.attValue(value);
18  }
19 
20  XMLAttribute.prototype.clone = function() {
21  return create(XMLAttribute.prototype, this);
22  };
23 
24  XMLAttribute.prototype.toString = function(options, level) {
25  return ' ' + this.name + '="' + this.value + '"';
26  };
27 
28  return XMLAttribute;
29 
30  })();
31 
32 }).call(this);