Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Simplified character and guild methods.

  • Loading branch information...
commit 7a08d553308962db17bb434964b9ad5e499577b9 1 parent 43fea8f
Christian Wesselhoeft authored December 16, 2012

Showing 1 changed file with 7 additions and 10 deletions. Show diff stats Hide diff stats

  1. 17  index.js
17  index.js
@@ -137,23 +137,20 @@ armory.realmStatus = function(options, callback) {
137 137
 }
138 138
 
139 139
 
140  
-// Retrieves an API resource in the form "/method/realm/name"
  140
+// Retrieves an object describing a character or guild.
141 141
 ;['character', 'guild'].forEach(function(method) {
142 142
   armory[method] = function(options, callback) {
143 143
     if (Array.isArray(options.fields)) {
144 144
       options.query.push('fields=' + options.fields.join())
145 145
     }
146 146
 
147  
-    var path = '/' + [
148  
-      method
149  
-    , options.realm
150  
-    , options.size
151  
-    ].filter(function(el) {
152  
-      return !!el
153  
-
154  
-    }).join('/') + '/' + options.name
  147
+    if (options.lastModified) {
  148
+      options.headers['If-Modified-Since'] = new Date(options.lastModified)
  149
+        .toUTCString()
  150
+    }
155 151
 
156  
-    this._get(path, options, callback)
  152
+    var path = '/' + [method, options.realm, options.id].join('/')
  153
+    return this._get(path, options, callback)
157 154
   }
158 155
 })
159 156
 

0 notes on commit 7a08d55

Please sign in to comment.
Something went wrong with that request. Please try again.