var Limit = function(keyName, ttl, maxLimit) {

	// {sourceName} inside the key name will be replaced by actual source name
	// {userID} inside the key name will be replaced by actual user ID
	this.keyName = keyName || "undefinedKey";
	// Time to live, in seconds
	this.ttl = ttl || Number.MAX_VALUE;
	// Maximum count for this limit
	this.maxLimit = maxLimit || Number.MAX_VALUE;
	
};

module.exports = Limit;

var Limit = function(keyName, ttl, maxLimit) {

	// {sourceName} inside the key name will be replaced by actual source name
	// {userID} inside the key name will be replaced by actual user ID
	if (keyName)
		this.keyName = keyName;
	else
		throw new Error("You have to set a key name for this limit!");
	// Time to live, in seconds
	if (ttl)
		this.ttl = ttl;
	else
		throw new Error("You have to set a TTL for " + keyName);
	// Maximum count for this limit
	if (maxLimit)
		this.maxLimit = maxLimit;
	else
		throw new Error ("You have to set a max limit for " + keyName);
	
};

module.exports = Limit;

Throw exceptions if key instances are not set
Throw exceptions if key instances are not set
