text:  // Inheritance model and sub-classes
   var vehicle = function(attrs) {
      var _privateObj = {
          hasEngine: true
      },
      that = {};
  
      that.name = attrs.name || null;
      that.engineSize = attrs.engineSize || null;
      that.hasEngine = function () {
          alert('This ' + that.name + ' has an engine: ' + _privateObj.hasEngine);
      };
  
      return that;
  }
  
  var motorbike = function () {
  
      // private
      var _privateObj = {
          numWheels: 2
      },
  
      // inherit
      that = vehicle({
          name: 'Motorbike',
          engineSize: 'Small'
      });
  
      // public
      that.totalNumWheels = function () {
          alert('This Motobike has ' + _privateObj.numWheels + ' wheels');
      };
  
      that.increaseWheels = function () {
          _privateObj.numWheels++;
      };
  
      return that;
  
  };
  
  var boat = function () {
  
      // inherit
      that = vehicle({
          name: 'Boat',
          engineSize: 'Large'
      });
  
      return that;
  
  };
  
  myBoat = boat();
  myBoat.hasEngine(); // This Boat has an engine: true
  alert(myBoat.engineSize); // Large
  
  myMotorbike = motorbike();
  myMotorbike.hasEngine(); // This Motorbike has an engine: true
  myMotorbike.increaseWheels();
  myMotorbike.totalNumWheels(); // This Motorbike has 3 wheels
  alert(myMotorbike.engineSize); // Small
  
  myMotorbike2 = motorbike();
  myMotorbike2.totalNumWheels(); // This Motorbike has 2 wheels
  
  myMotorbike._privateObj.numWheels = 0; // undefined
  myBoat.totalNumWheels(); // undefined
  
  
  
  