title: How to extend jQuery plugin's methods?
body: <p>In the following code i tried to extend my test plugin. I want to add a new method definition to existing plugin.</p>
  
  <pre><code>(function($) {
      var settings = {
          bg: 'white'
      };
  
      var methods = {
          init: function(options) {
              options = $.extend({}, options, settings);
              return this.each(function () {
                  $(this).data("test", options);
              });
          },
          whiten: function() {
              var options = this.data("test");
              this.css('background-color', options.bg);
          }
      };
  
      $.fn.test = function(method) {
          if (methods[method]) {
              return methods[method].apply(this, Array.prototype.slice.call(arguments, 1));
          } else if (typeof method === 'object' || !method) {
              return methods.init.apply(this, arguments);
          } else {
              $.error('Method ' + method + ' does not exist');
          } 
      }  
  
  })(jQuery);
  
  // New Method Definition
   var methods = {     
          newMethod: function(){
              alert('umut');   
        }
   };
  
  
  // Extending test plugin with newMethod
  $.fn.extend(true,$.fn.test, methods );
  
  $(document).ready(function() {
      $('ul').test().css('background-color', 'wheat');
      $('#go').click(function() {
          $('ul').test("whiten");
          // Calling newMethod
          $('ul').test("newMethod");    
      });
  });
  </code></pre>
  
  <p>But i got following error at firebug console:</p>
  
  <blockquote>
    <p>uncaught exception: Method newMethod does not exist</p>
  </blockquote>
  
  <p>How can i extend </p>
  
  <pre><code>var methods = {
  }
  </code></pre>
  
  <p>block inside my test plugin?</p>
  
  <p>Here is the jsfiddle <a href="http://jsfiddle.net/gurkavcu/NSVVv/1/" rel="nofollow">link</a>.</p>