Permalink
Browse files

Updated realmStatus method.

  • Loading branch information...
1 parent 3cddc67 commit 06d4387710ccba8a7f1b2a80a1af524df1a36b16 @xtian committed Dec 16, 2012
Showing with 11 additions and 11 deletions.
  1. +11 −11 index.js
View
@@ -138,30 +138,30 @@ armory.rbgLadder = function(options, callback) {
return this._get(path, options, cb)
}
-// Retrieves array of realm objects with status info
+// Retrieves array of realm status information.
armory.realmStatus = function(options, callback) {
var path = '/realm/status'
// Multiple realms
- if (Array.isArray(options.name)) {
- options.name = options.name.join('&realm=')
+ if (Array.isArray(options.id)) {
+ options.id = options.id.join('&realm=')
}
// Single realm or joined realms
- if (options.name) {
- options.query.push('realm=' + options.name)
+ if (options.id) {
+ options.query.push('realm=' + options.id)
}
- this._get(path, options, function(err, res) {
- if (err) {
- return callback(err)
+ if (callback) {
+ var cb = function(err, body, res) {
+ var data = getKey(body, 'realms')
+ callback.call(this, err, data, res)
}
+ }
- callback(null, res.realms)
- })
+ return this._get(path, options, cb)
}
-
// Retrieves an object describing a character or guild.
;['character', 'guild'].forEach(function(method) {
armory[method] = function(options, callback) {

0 comments on commit 06d4387

Please sign in to comment.