Permalink
Browse files

Merge pull request #4 from sergiolepore/master

Minor fixes
  • Loading branch information...
2 parents 729e3f5 + 5377acd commit 3292d316a212a07d6a1f5a990142e33e1b4853f8 Sergio Lepore committed Oct 18, 2012
Showing with 17 additions and 18 deletions.
  1. +17 −18 lib/cation.js
View
@@ -6,8 +6,8 @@ var cation = module.exports = function(parameters, services) {
/**
* Adds new parameter/s to Service Container.
- *
- * @param {json} parameters Parameters defined by JSON format: {'name':'value'}
+ *
+ * @param {json} parameters Parameters in JSON format: {'name':'value'}
* @return {cation}
*/
cation.addParameters = function(parameters) {
@@ -21,8 +21,8 @@ var cation = module.exports = function(parameters, services) {
/**
* Adds new service definition/s to Service Container.
- *
- * @param {json} definition Definition defined by JSON format: { 'alias': { 'require': 'mod', 'args': ['a'] } }
+ *
+ * @param {json} definition Definition in JSON format: { 'alias': { 'require': 'mod', 'args': ['a'] } }
* @return {cation}
*/
cation.addServiceDefinition = function(definition) {
@@ -36,7 +36,6 @@ var cation = module.exports = function(parameters, services) {
/**
* Gets all loaded parameters.
- *
* @return {json}
*/
cation.getParameterBag = function() {
@@ -45,7 +44,7 @@ var cation = module.exports = function(parameters, services) {
/**
* Gets all loaded services.
- *
+ *
* @return {json}
*/
cation.getServiceBag = function() {
@@ -54,7 +53,7 @@ var cation = module.exports = function(parameters, services) {
/**
* Checks if the given service is defined on the container.
- *
+ *
* @param {string} service_alias Service alias (defined in service definition)
* @return {Boolean}
*/
@@ -64,7 +63,7 @@ var cation = module.exports = function(parameters, services) {
/**
* Checks if the given service is loaded in memory.
- *
+ *
* @param {string} service_alias
* @return {Boolean}
*/
@@ -73,9 +72,9 @@ var cation = module.exports = function(parameters, services) {
};
/**
- * Gets a service.
+ * Gets a service.
* This method constructs an object based on the service definition.
- *
+ *
* @param {string} service_alias Service alias (defined in service definition)
* @return {object}
*/
@@ -150,7 +149,7 @@ var cation = module.exports = function(parameters, services) {
/**
* Extracts a given parameter value contained on service definition.
- *
+ *
* @param {json} definition
* @param {string} param_name
* @param {} default_value
@@ -166,7 +165,7 @@ var cation = module.exports = function(parameters, services) {
/**
* Replaces all occurences of %param% with the value previously setted on the container.
- *
+ *
* @param {string} target
* @return {string}
*/
@@ -180,15 +179,15 @@ var cation = module.exports = function(parameters, services) {
replacement = parameter_bag[clean_param_name];
purged_params = purged_params.replace(found_params[i], replacement);
- }
+ }
}
return purged_params;
};
/**
* Replaces all occurences of @something with the specified service instance.
- *
+ *
* @param {string} parent_alias
* @param {string} target
* @param {function} onSuccess
@@ -219,14 +218,14 @@ var cation = module.exports = function(parameters, services) {
/**
* Dynamically creates an object by giving the function and arguments to be injected on construction.
- *
+ *
* @param {Function} fn
* @param {array} args
* @return {object}
*/
var dispatchObject = function(fn, args) {
if (typeof fn === 'function') {
- return fn.apply(this, args || []);
+ return fn.apply(this, args || []);
} else {
return fn;
}
@@ -244,7 +243,7 @@ var cation = module.exports = function(parameters, services) {
/**
* Success callback.
- *
+ *
* @param {string} service_alias
* @return {}
*/
@@ -254,7 +253,7 @@ var cation = module.exports = function(parameters, services) {
/**
* Error callback.
- *
+ *
* @param {string} service_alias
* @param {string} err
* @return {}

0 comments on commit 3292d31

Please sign in to comment.