module pattern and document.ready
<p>I have start learn javascript module patterns. And I have the following code:  </p>

<pre><code>// PersonalInformation.js

var PersonallInformation = (function () { 

   $.validator.addMethod("checkPhoneNumber", function (value, element) {

        if (!value) return true;
        return /^((\+7)|8)(700|701|702|705|707|712|713|717|718,721|725|726|727|777)[0-9]{7}$/.test(value);
    }, "Wrong phone format");

    function updateQTip() {

        $('div.invalid_form').qtip({
            content: function (api) {
                var text = $(this).prev();
                return "&lt;div class='tip_cont'&gt;&lt;span class='simple cost'&gt;&lt;span class='corner'&gt;&lt;/span&gt;" + $(text).attr('data-description') + "&lt;/span&gt;&lt;/div&gt;";
            },
            position: {
                target: 'mouse',
                adjust: { x: 5, y: 17 }
            },
            style: {
                tip: { corner: false }
            }
        });
    }

    function updateError() {
        $('.invalid_form').closest('.wrap_input').addClass('error');
        $('#reg_form_pay input').each(function(element) {
            if ($(this).hasClass('invalid_form')) {
                $(this).closest('.wrap_input').addClass('error');
            } else {
                $(this).closest('.wrap_input').removeClass('error');
            }
        });
        updateQTip();
    }

    function validateForm() {
        $("#reg_form_pay").validate({
            rules: {
                Email: { required: true, email: true },
                PhoneNumber: { required: true, checkPhoneNumber: true },
                FirstName: { required: true },
                Surname: { required: true }
            },
            messages: {
                Email: '',
                PhoneNumber: '',
                FirstName: '',
                Surname: ''
            },
            errorClass: "invalid_form",
            errorElement: "div",
            errorPlacement: function (error, element) {
                error.insertAfter(element);
            },
            onkeyup: false,
            showErrors: function (errorMap, errorList) {

                this.defaultShowErrors();
                updateError();
            }
        });
    }

    function privateInit() {
        validateForm();
        console.log('init ok');
    }


    return {
        init: privateInit,
    };
}());
</code></pre>

<p>To start working this code I must call <code>init</code> method. In the view I have:</p>

<pre><code>&lt;script&gt;
    $(document).ready(function() {
        PersonallInformation.init();
    })        
&lt;/script&gt;
</code></pre>

<p>This is possible avoid call method in the view?</p>

<p><strong>UPDATE:</strong>
I have rewrite it in the following way:</p>

<pre><code>function library(module) {
    $(function() {
        if (module.init) {
            module.init();
        }
    });
    return module;
}

var PersonallInformation = library(function () {
...
</code></pre>
