Call the same instance of jQuery plugin
<p>I have written a jQuery plugin below and would like to be able to call it again for the same instance on an element.</p>

<p>The plugin goes...</p>

<pre><code>(function($) {
    $.fn.myPlugin = function(options){

        var settings = {
            color: null
        };

        if (options) {  
            $.extend(settings, options);
        }

        return this.each(function(){
            var self = this;
            var pics = $('li', self);

            function refresh() {
                pics = $('li', self);
            };

            $('a', self).click(function(){
                pics.filter(':last').remove();
                alert(settings.color);
                refresh();
                return false;
            });
        });
    }
})(jQuery);
</code></pre>

<p>In the page this is called...</p>

<pre><code>$('#test').myPlugin({ color: 'blue' });
</code></pre>

<p>Now I want to call the same plugin for the same instance but pass the string <code>refresh</code> as the option whilst all the other variables are the same (so color would still be <code>blue</code>) e.g...</p>

<pre><code>$('#test').myPlugin('refresh');
</code></pre>

<p>This would then execute the <code>refresh()</code> function.</p>

<p>How could I achieve that with the above?</p>

<p><strong>Edit:</strong> To make it clearer I am thinking of how jQuery UI does their plugins. In the <a href="http://jqueryui.com/demos/sortable/" rel="nofollow">sortable</a> plugin you can do <code>$("#sortable").sortable();</code> and then <code>$("#sortable").sortable('refresh');</code> on the same element. This is what I am trying to achieve.</p>
