A method inside the plugin

A method inside the plugin

Hi,
I cant remember how to put a method inside the plugin.

Eg

(function( $ ){
    $.fn.myPlugin = function(options) {
        var defaults = {
        };

        var options = $.extend( defaults, options );
        var that = this;

        return this.each(function() {
              ....
              someelement.onclick(function() {
                 that.method(this);
              });
        },

        method = function(el) {
           console.log(el);
        }
})(jQuery);


Gives me a
d is undefined
jquery....min.js (line 49)

Isnt that correct?