﻿
/**
 * @file Delegate.js
 * @author Adam Grant
 * @created Feb 7, 2008
 * @copyright (C) 2008 Global Media Services, All rights reserved.
 **/

/**
 * @class Delegate
 * Has static method for creating delegate Functions within a particular scope (context)
 **/
function Delegate(context, delegate) {
	return Delegate.create(context, delegate);
}

/**
 * @method create
 * @param context:Object; object context to be used when delegate is called
 * @param delegate:Function
 * @returns Function
 **/
Delegate.create = function(context, delegate) {
	return function() { delegate.apply(context, arguments); };
};
