I'm working on a custom extension of a couple of functions to the
Object class and was just wondering how prototype connects functions
such as Object.inspect(variable); to variable.inspect();

So far I have:

Object.extend(Object.prototype, {
        talk: function(object)
        {
                if(typeof(this) != 'function')
                        object = this;

                alert(object);
        }
});

var test = 'hi';

Object.talk(test);
test.talk();

This seems like it should work for simple cases but will quickly
become more complicated if I want more that just the one parameter.
Given the amount that things like this are done in prototype I was
just wondering if there is a better way to accomplish this.

Thanks,
- Sean

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to