/*
iFace.js - A simple interface-like thing.
Copyright (c) 2009 Thomas Peri - http://www.tumuski.com/
MIT License
*/
var iFace=function(name,members){var iF,fromCons,consName,quote;iF=function(n,fn){var c;if(typeof n==='function'){fn=n;n=fn.$iFaceConstructorName;}c=function(){fn.apply(this,arguments);consName=n;fromCons=true;iF.verify(this);fromCons=false;};c.$iFaceConstructorName=n;return c;};iF.verify=function(obj,objName){var i,m;for(i=0;i<members.length;i+=1){m=members[i];if(!obj.hasOwnProperty(m)){throw"The "+(fromCons?quote(consName)+"constructor assigns":quote(objName)+"object has")+" no '"+m+"' member, required by the iFace '"+name+"'.";}}};quote=function(n){return n?("'"+n+"' "):"";};return iF;};