code: function (ruler, index) {
  			var rulers = this._rulers;
  			if (index !== undefined) {
  				var i, sideIndex;
  				for (i = 0, sideIndex=0; i < rulers.length && sideIndex < index; i++) {
  					if (ruler.getLocation() === rulers[i].getLocation()) {
  						sideIndex++;
  					}
  				}
  				rulers.splice(sideIndex, 0, ruler);
  				index = sideIndex;
  			} else {
  				rulers.push(ruler);
  			}
  			this._createRuler(ruler, index);
  			ruler.setView(this);
  			this._update();
  		}
docs: Adds a ruler to the text view at the specified position.
  <p>
  The position is relative to the ruler location.
  </p>
  
  @param {orion.editor.Ruler} ruler the ruler.
  @param {Number} [index=length] the ruler index.