help detecting options if they have been entered...

help detecting options if they have been entered...

I was wondering if this does not exist already then it would be very handy.

$('#selector').myUI();//does not have options.
$('#selector').myUI({option:'foo',{op:'bar'}});//ui has options.
$('#selector').myUI('value');//ui has options.

while on myUI

we have:

this.options
this.element
etc..

It would be useful if we had
this.hasOptions

which would bool (true,false)
so if the ui is called with options then do something
else do something else.

for instance:

we could use it in the following way.

<div class="list">
      <div>item name</div>
      <div>item value</div>
</div>

option 1:
$('div.list').myUI();//does not have options.
then we use the element to contruct...

option 2:
$('<div />').myUI({list:{item:'I am Item',value:'im a value'}})
//so the options can be changed to divs as the above structure?