Permalink
Browse files

Updated documentation

  • Loading branch information...
1 parent f41c021 commit 0a14af13f9ce71ee55a7732765179893bc895520 @chriso committed May 12, 2011
View
@@ -13,7 +13,7 @@
* Reference:
* http://redis.io/commands#string
*
- * Redis structure:
+ * Redis Structure:
* `(namespace:)cache_namespace:key = string`
*/
@@ -38,15 +38,15 @@ Cache.prototype.getKey = function (key) {
* Cache one or more values.
*
* To cache a single value by key:
- * cache.set('foo', 'bar', callback);
+ * `cache.set('foo', 'bar', callback);`
*
* To set multiple cached values by key:
- * cache.set({foo:'bar', key2:'value2'}, callback);
+ * `cache.set({foo:'bar', key2:'value2'}, callback);`
*
* @param {string} key
* @param {string} value
* @param {Function} callback (optional)
- * @return this;
+ * @return this
* @api public
*/
@@ -77,7 +77,7 @@ Cache.prototype.set = function (key, value, expiry, callback) {
* @param {string|Object} key
* @param {string} value (optional)
* @param {Function} callback (optional)
- * @return this;
+ * @return this
* @api public
*/
@@ -102,18 +102,18 @@ Cache.prototype.add = function (key, value, callback) {
* Get one or more values from the cache.
*
* To get a single cached value by key:
- * cache.get('foo', callback);
+ * `cache.get('foo', callback);`
*
* To get multiple cached values by key:
- * cache.get(['foo','bar'], callback);
+ * `cache.get(['foo','bar'], callback);`
*
* To get all cached values:
- * cache.get(callback);
+ * `cache.get(callback);`
*
* @param {string} key
* @param {string} value
* @param {Function} callback
- * @return this;
+ * @return this
* @api public
*/
@@ -161,7 +161,7 @@ Cache.prototype.get = function (key, callback) {
* @param {string} key
* @param {string} value
* @param {Function} callback
- * @return this;
+ * @return this
* @api public
*/
@@ -175,7 +175,7 @@ Cache.prototype.getSet = function (key, value, callback) {
*
* @param {string} key
* @param {Function} callback
- * @return this;
+ * @return this
* @api public
*/
@@ -190,11 +190,12 @@ Cache.prototype.exists = function (key, callback) {
* @param {string} key
* @param {int} amount (optional - default is 1)
* @param {Function} callback (optional)
- * @return this;
+ * @return this
* @api public
*/
-Cache.prototype.increment = Cache.prototype.incrBy = function (key, amount, callback) {
+Cache.prototype.increment =
+Cache.prototype.incrBy = function (key, amount, callback) {
callback = callback || function () {};
if (typeof amount === 'function') {
callback = amount;
@@ -210,11 +211,12 @@ Cache.prototype.increment = Cache.prototype.incrBy = function (key, amount, call
* @param {string} key
* @param {int} amount (optional - default is 1)
* @param {Function} callback (optional)
- * @return this;
+ * @return this
* @api public
*/
-Cache.prototype.decrement = Cache.prototype.decrBy = function (key, amount, callback) {
+Cache.prototype.decrement =
+Cache.prototype.decrBy = function (key, amount, callback) {
callback = callback || function () {};
if (typeof amount === 'function') {
callback = amount;
@@ -230,7 +232,7 @@ Cache.prototype.decrement = Cache.prototype.decrBy = function (key, amount, call
* @param {string} pattern (optional - default is *)
* @param {bool} keep_namespace (optional - default is false)
* @param {Function} callback
- * @return this;
+ * @return this
* @api public
*/
@@ -269,7 +271,7 @@ Cache.prototype.keys = function (pattern, keep_namespace, callback) {
*
* @param {string} pattern (optional - default is *)
* @param {Function} callback (optional)
- * @return this;
+ * @return this
* @api public
*/
View
@@ -14,7 +14,7 @@ var redis = require('redis'),
Cache = require('./Cache').Cache;
/**
- * Define the Redis structures.
+ * Define the available Redis structures.
*/
var base = ['Hash','List','Set','SortedSet','Bitfield'];
@@ -129,7 +129,7 @@ exports.createClient = function (host, port, options) {
}
/**
- * Add the base structures from ./base_structures
+ * Add the Redis structures from ./base_structures
*/
base.forEach(function (structure) {
@@ -160,4 +160,4 @@ Redback.prototype.NINF = exports.NINF = '-inf';
exports.Client = redis.RedisClient;
exports.Structure = Structure.Structure;
exports.Cache = Cache;
-exports.Channel
+exports.Channel = Channel;
@@ -12,7 +12,7 @@ var List = require('../base_structures/List').List;
/**
* A Redis list with a fixed length. Each command that adds a value to the
- * list is followed by an LTRIM command.
+ * list is followed by an `LTRIM` command.
*
* Usage:
* `redback.createCappedList(key [, max_length]);`
@@ -32,7 +32,7 @@ var CappedList = exports.CappedList = List.prototype.extend();
*
* @param {int} length - the maximum length of the list
* @param {Function} callback
- * @api public
+ * @api private
*/
CappedList.prototype.init = function (length) {
@@ -14,14 +14,14 @@ var Structure = require('../Structure');
* Build a social graph similar to Twitter's.
*
* Usage:
- * `redback.createSocialGraph(user_id [, prefix]);`
+ * `redback.createSocialGraph(id [, prefix]);`
*
* Reference:
* http://redis.io/topics/data-types#sets
*
* Redis Structure:
- * `(namespace:)(prefix:)user_id:following = set(user_ids)`
- * `(namespace:)(prefix:)user_id:followers = set(user_ids)`
+ * `(namespace:)(prefix:)id:following = set(ids)`
+ * `(namespace:)(prefix:)id:followers = set(ids)`
*/
var SocialGraph = exports.SocialGraph = Structure.new();
@@ -30,7 +30,7 @@ var Bitfield = exports.Bitfield = Structure.new();
*
* @param {int} bit
* @param {Function} callback (optional)
- * @return this;
+ * @return this
* @api public
*/
@@ -46,7 +46,7 @@ Bitfield.prototype.get = function (bit, callback) {
* @param {int} bit
* @param {bool} value
* @param {Function} callback (optional)
- * @return this;
+ * @return this
* @api public
*/
@@ -29,7 +29,7 @@ var Hash = exports.Hash = Structure.new();
* Get an array of hash keys.
*
* @param {Function} callback
- * @return this;
+ * @return this
* @api public
*/
@@ -42,7 +42,7 @@ Hash.prototype.keys = function (callback) {
* Get an array of hash values.
*
* @param {Function} callback
- * @return this;
+ * @return this
* @api public
*/
@@ -55,7 +55,7 @@ Hash.prototype.values = function (callback) {
* Get the number of hash keys.
*
* @param {Function} callback
- * @return this;
+ * @return this
* @api public
*/
@@ -69,7 +69,7 @@ Hash.prototype.length = function (callback) {
*
* @param {string} hash_key
* @param {Function} callback (optional)
- * @return this;
+ * @return this
* @api public
*/
@@ -84,7 +84,7 @@ Hash.prototype.delete = Hash.prototype.del = function (hash_key, callback) {
*
* @param {string} hash_key
* @param {Function} callback
- * @return this;
+ * @return this
* @api public
*/
@@ -97,15 +97,15 @@ Hash.prototype.exists = function (hash_key, callback) {
* Sets one or more key/value pairs.
*
* To set one key/value pair:
- * hash.set('foo', 'bar', callback);
+ * `hash.set('foo', 'bar', callback);`
*
* To set multiple:
- * hash.set({key1:'value1', key2:'value2}, callback);
+ * `hash.set({key1:'value1', key2:'value2}, callback);`
*
* @param {string|Object} hash_key
* @param {string} value (optional)
* @param {Function} callback (optional)
- * @return this;
+ * @return this
* @api public
*/
@@ -121,12 +121,12 @@ Hash.prototype.set = function (hash_key, value, callback) {
}
/**
- * Sets a key/value pair but only if the key doesn't already exist.
+ * Sets a key/value pair if the key doesn't already exist.
*
* @param {string} hash_key
* @param {string} value
* @param {Function} callback
- * @return this;
+ * @return this
* @api public
*/
@@ -140,15 +140,15 @@ Hash.prototype.add = function (hash_key, value, callback) {
* Gets one or more key/value pairs.
*
* To get all key/value pairs in the hash:
- * hash.get('foo', callback);
+ * `hash.get('foo', callback);`
*
* To get certain key/value pairs:
- * hash.get(['foo','bar'], callback);
- * hash.get('foo', callback);
+ * `hash.get(['foo','bar'], callback);`
+ * `hash.get('foo', callback);`
*
* @param {string} hash_key (optional)
* @param {Function} callback
- * @return this;
+ * @return this
* @api public
*/
@@ -170,7 +170,7 @@ Hash.prototype.get = function (hash_key, callback) {
* @param {string} hash_key
* @param {int} amount (optional - default is 1)
* @param {Function} callback (optional)
- * @return this;
+ * @return this
* @api public
*/
@@ -191,7 +191,7 @@ Hash.prototype.incrBy = function (hash_key, amount, callback) {
* @param {string} hash_key
* @param {int} amount (optional - default is 1)
* @param {Function} callback (optional)
- * @return this;
+ * @return this
* @api public
*/
@@ -26,7 +26,7 @@ var Structure = require('../Structure');
var List = exports.List = Structure.new();
/**
- * Get an array of values in the list.
+ * Get the list as an array.
*
* @param {Function} callback
* @return this
@@ -61,7 +61,7 @@ List.prototype.range = function (start, end, callback) {
* Get one or more elements starting at the specified index.
*
* @param {int} index
- * @param {count} count (optional - defaults to 1)
+ * @param {count} count (optional - default is 1)
* @param {Function} callback
* @return this
* @api public
@@ -81,7 +81,7 @@ List.prototype.get = function (index, count, callback) {
* Cap the length of the list.
*
* @param {int} length
- * @param {bool} keep_earliest (optional - defaults to false)
+ * @param {bool} keep_earliest (optional - default is false)
* @param {Function} callback (optional)
* @return this
* @api public
@@ -103,10 +103,10 @@ List.prototype.cap = function (length, keep_earliest, callback) {
}
/**
- * Remove one or more list elements matching the value
+ * Remove one or more list elements matching the value.
*
* @param {string} value
- * @param {bool} count (optional - defaults to 1)
+ * @param {bool} count (optional - default is 1)
* @param {Function} callback (optional)
* @return this
* @api public
@@ -123,11 +123,11 @@ List.prototype.remove = function (value, count, callback) {
}
/**
- * Trim a list to the specified range.
+ * Trim a list to the specified bounds.
*
* @param {int} start
* @param {int} end
- * @param {Function} callback (optional_
+ * @param {Function} callback (optional)
* @return this
* @api public
*/
Oops, something went wrong.

0 comments on commit 0a14af1

Please sign in to comment.