myspace-ruby 0.7.0 → 0.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -58,6 +58,10 @@
58
58
  <a href="../../files/lib/myspace/object_rb.html">
59
59
  lib/myspace/object.rb
60
60
  </a>
61
+ <br />
62
+ <a href="../../files/pkg/myspace-ruby-0_7_0/lib/myspace/object_rb.html">
63
+ pkg/myspace-ruby-0.7.0/lib/myspace/object.rb
64
+ </a>
61
65
  <br />
62
66
  </td>
63
67
  </tr>
@@ -88,12 +92,18 @@
88
92
  <h3 class="section-bar">Methods</h3>
89
93
 
90
94
  <div class="name-list">
91
- <a href="#M000032">build_request</a>&nbsp;&nbsp;
92
- <a href="#M000034">get</a>&nbsp;&nbsp;
93
- <a href="#M000033">get_raw</a>&nbsp;&nbsp;
94
- <a href="#M000030">json_to_obj</a>&nbsp;&nbsp;
95
- <a href="#M000031">json_to_obj_collection</a>&nbsp;&nbsp;
96
- <a href="#M000029">new</a>&nbsp;&nbsp;
95
+ <a href="#M000056">build_request</a>&nbsp;&nbsp;
96
+ <a href="#M000050">build_request</a>&nbsp;&nbsp;
97
+ <a href="#M000052">get</a>&nbsp;&nbsp;
98
+ <a href="#M000058">get</a>&nbsp;&nbsp;
99
+ <a href="#M000051">get_raw</a>&nbsp;&nbsp;
100
+ <a href="#M000057">get_raw</a>&nbsp;&nbsp;
101
+ <a href="#M000048">json_to_obj</a>&nbsp;&nbsp;
102
+ <a href="#M000054">json_to_obj</a>&nbsp;&nbsp;
103
+ <a href="#M000055">json_to_obj_collection</a>&nbsp;&nbsp;
104
+ <a href="#M000049">json_to_obj_collection</a>&nbsp;&nbsp;
105
+ <a href="#M000053">new</a>&nbsp;&nbsp;
106
+ <a href="#M000047">new</a>&nbsp;&nbsp;
97
107
  </div>
98
108
  </div>
99
109
 
@@ -115,11 +125,11 @@
115
125
  <div id="methods">
116
126
  <h3 class="section-bar">Public Class methods</h3>
117
127
 
118
- <div id="method-M000032" class="method-detail">
119
- <a name="M000032"></a>
128
+ <div id="method-M000056" class="method-detail">
129
+ <a name="M000056"></a>
120
130
 
121
131
  <div class="method-heading">
122
- <a href="#M000032" class="method-signature">
132
+ <a href="#M000056" class="method-signature">
123
133
  <span class="method-name">build_request</span><span class="method-args">(params,optParams=nil,format=&quot;json&quot;)</span>
124
134
  </a>
125
135
  </div>
@@ -129,8 +139,64 @@
129
139
  Builds a REST request based on the supplied params and optParams
130
140
  </p>
131
141
  <p><a class="source-toggle" href="#"
132
- onclick="toggleCode('M000032-source');return false;">[Source]</a></p>
133
- <div class="method-source-code" id="M000032-source">
142
+ onclick="toggleCode('M000056-source');return false;">[Source]</a></p>
143
+ <div class="method-source-code" id="M000056-source">
144
+ <pre>
145
+ <span class="ruby-comment cmt"># File pkg/myspace-ruby-0.7.0/lib/myspace/object.rb, line 53</span>
146
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">build_request</span>(<span class="ruby-identifier">params</span>,<span class="ruby-identifier">optParams</span>=<span class="ruby-keyword kw">nil</span>,<span class="ruby-identifier">format</span>=<span class="ruby-value str">&quot;json&quot;</span>)
147
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">params</span> <span class="ruby-operator">==</span> <span class="ruby-constant">Array</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">params</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator">!=</span> <span class="ruby-ivar">@numParams</span>
148
+ <span class="ruby-identifier">raise</span> <span class="ruby-constant">InvalidRequestParams</span>.<span class="ruby-identifier">new</span>(
149
+ <span class="ruby-node">&quot;#{self}.get needs #{@numParams} (#{@pathFormat})&quot;</span>)
150
+ <span class="ruby-keyword kw">end</span>
151
+
152
+ <span class="ruby-identifier">raise</span> <span class="ruby-constant">InvalidRequest</span>.<span class="ruby-identifier">new</span>(
153
+ <span class="ruby-node">&quot;try a collection of #{self} objects&quot;</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@pathFormat</span>.<span class="ruby-identifier">nil?</span>
154
+
155
+ <span class="ruby-keyword kw">begin</span>
156
+ <span class="ruby-identifier">path</span> = <span class="ruby-node">&quot;/#{API_VERSION}#{@pathFormat % params}.#{format}&quot;</span>
157
+ <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Exception</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span>
158
+ <span class="ruby-identifier">raise</span> <span class="ruby-constant">InvalidRequestParams</span>.<span class="ruby-identifier">new</span>(
159
+ <span class="ruby-node">&quot;couldn't build a path from params '#{params.join(&quot;'&quot;)}' \
160
+ and format string #{@pathFormat}. Exception is: (#{e})&quot;</span>)
161
+ <span class="ruby-keyword kw">end</span>
162
+
163
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">optParams</span>
164
+ <span class="ruby-identifier">raise</span> <span class="ruby-constant">InvalidRequestParams</span>.<span class="ruby-identifier">new</span>(
165
+ <span class="ruby-value str">&quot;optParams should be a Hash.&quot;</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">optParams</span>.<span class="ruby-identifier">kind_of?</span>(<span class="ruby-constant">Hash</span>)
166
+
167
+ <span class="ruby-identifier">path</span> <span class="ruby-operator">+=</span> <span class="ruby-value str">&quot;?&quot;</span>
168
+
169
+ <span class="ruby-identifier">optParams</span>.<span class="ruby-identifier">each</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">k</span>,<span class="ruby-identifier">v</span><span class="ruby-operator">|</span>
170
+ <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@optParams</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-operator">!</span><span class="ruby-ivar">@optParams</span>.<span class="ruby-identifier">has_key?</span>(<span class="ruby-identifier">k</span>)
171
+ <span class="ruby-identifier">raise</span> <span class="ruby-constant">InvalidRequestParams</span>.<span class="ruby-identifier">new</span>(<span class="ruby-node">&quot;option '#{k}' is not valid.&quot;</span>)
172
+ <span class="ruby-keyword kw">end</span>
173
+ <span class="ruby-identifier">path</span> <span class="ruby-operator">+=</span> <span class="ruby-node">&quot;#{k}=#{v}&amp;&quot;</span>
174
+ }
175
+ <span class="ruby-identifier">path</span>.<span class="ruby-identifier">sub!</span>(<span class="ruby-regexp re">/&amp;$/</span>,<span class="ruby-value str">&quot;&quot;</span>)
176
+ <span class="ruby-keyword kw">end</span>
177
+ <span class="ruby-identifier">path</span>
178
+ <span class="ruby-keyword kw">end</span>
179
+ </pre>
180
+ </div>
181
+ </div>
182
+ </div>
183
+
184
+ <div id="method-M000050" class="method-detail">
185
+ <a name="M000050"></a>
186
+
187
+ <div class="method-heading">
188
+ <a href="#M000050" class="method-signature">
189
+ <span class="method-name">build_request</span><span class="method-args">(params,optParams=nil,format=&quot;json&quot;)</span>
190
+ </a>
191
+ </div>
192
+
193
+ <div class="method-description">
194
+ <p>
195
+ Builds a REST request based on the supplied params and optParams
196
+ </p>
197
+ <p><a class="source-toggle" href="#"
198
+ onclick="toggleCode('M000050-source');return false;">[Source]</a></p>
199
+ <div class="method-source-code" id="M000050-source">
134
200
  <pre>
135
201
  <span class="ruby-comment cmt"># File lib/myspace/object.rb, line 53</span>
136
202
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">build_request</span>(<span class="ruby-identifier">params</span>,<span class="ruby-identifier">optParams</span>=<span class="ruby-keyword kw">nil</span>,<span class="ruby-identifier">format</span>=<span class="ruby-value str">&quot;json&quot;</span>)
@@ -171,23 +237,23 @@ Builds a REST request based on the supplied params and optParams
171
237
  </div>
172
238
  </div>
173
239
 
174
- <div id="method-M000034" class="method-detail">
175
- <a name="M000034"></a>
240
+ <div id="method-M000052" class="method-detail">
241
+ <a name="M000052"></a>
176
242
 
177
243
  <div class="method-heading">
178
- <a href="#M000034" class="method-signature">
244
+ <a href="#M000052" class="method-signature">
179
245
  <span class="method-name">get</span><span class="method-args">(params,optParams=nil)</span>
180
246
  </a>
181
247
  </div>
182
248
 
183
249
  <div class="method-description">
184
250
  <p>
185
- Performs a <a href="Object.html#M000034">get</a> request to the API servers
251
+ Performs a <a href="Object.html#M000052">get</a> request to the API servers
186
252
  and returns some <a href="../MySpace.html">MySpace</a> object
187
253
  </p>
188
254
  <p><a class="source-toggle" href="#"
189
- onclick="toggleCode('M000034-source');return false;">[Source]</a></p>
190
- <div class="method-source-code" id="M000034-source">
255
+ onclick="toggleCode('M000052-source');return false;">[Source]</a></p>
256
+ <div class="method-source-code" id="M000052-source">
191
257
  <pre>
192
258
  <span class="ruby-comment cmt"># File lib/myspace/object.rb, line 94</span>
193
259
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">get</span>(<span class="ruby-identifier">params</span>,<span class="ruby-identifier">optParams</span>=<span class="ruby-keyword kw">nil</span>)
@@ -201,7 +267,6 @@ and returns some <a href="../MySpace.html">MySpace</a> object
201
267
  <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@dataType</span> <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;Hash&quot;</span>
202
268
  <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">json_to_obj</span>(<span class="ruby-identifier">body</span>)
203
269
  <span class="ruby-keyword kw">elsif</span> <span class="ruby-ivar">@dataType</span> <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;Array&quot;</span>
204
- <span class="ruby-identifier">body</span>.<span class="ruby-identifier">sub!</span>(<span class="ruby-regexp re">/\{&quot;Groups&quot;\:/</span>,<span class="ruby-value str">'{&quot;groups&quot;:'</span>) <span class="ruby-comment cmt"># you did not see this</span>
205
270
  <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">json_to_obj_collection</span>(<span class="ruby-identifier">body</span>)
206
271
  <span class="ruby-keyword kw">else</span>
207
272
  <span class="ruby-identifier">raise</span> <span class="ruby-constant">InvalidRequestParams</span>.<span class="ruby-identifier">new</span>(<span class="ruby-node">&quot;#{@dataType} is not a valid data type.&quot;</span>)
@@ -212,11 +277,51 @@ and returns some <a href="../MySpace.html">MySpace</a> object
212
277
  </div>
213
278
  </div>
214
279
 
215
- <div id="method-M000033" class="method-detail">
216
- <a name="M000033"></a>
280
+ <div id="method-M000058" class="method-detail">
281
+ <a name="M000058"></a>
217
282
 
218
283
  <div class="method-heading">
219
- <a href="#M000033" class="method-signature">
284
+ <a href="#M000058" class="method-signature">
285
+ <span class="method-name">get</span><span class="method-args">(params,optParams=nil)</span>
286
+ </a>
287
+ </div>
288
+
289
+ <div class="method-description">
290
+ <p>
291
+ Performs a <a href="Object.html#M000052">get</a> request to the API servers
292
+ and returns some <a href="../MySpace.html">MySpace</a> object
293
+ </p>
294
+ <p><a class="source-toggle" href="#"
295
+ onclick="toggleCode('M000058-source');return false;">[Source]</a></p>
296
+ <div class="method-source-code" id="M000058-source">
297
+ <pre>
298
+ <span class="ruby-comment cmt"># File pkg/myspace-ruby-0.7.0/lib/myspace/object.rb, line 94</span>
299
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">get</span>(<span class="ruby-identifier">params</span>,<span class="ruby-identifier">optParams</span>=<span class="ruby-keyword kw">nil</span>)
300
+
301
+ <span class="ruby-identifier">path</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">build_request</span>(<span class="ruby-identifier">params</span>,<span class="ruby-identifier">optParams</span>)
302
+ <span class="ruby-comment cmt">#puts &quot;#{path} pathFormat #{@pathFormat} childType #{@childType} </span>
303
+ <span class="ruby-comment cmt">#childBase #{@childBase} numParams #{@numParams}&quot;</span>
304
+
305
+ <span class="ruby-identifier">body</span> = <span class="ruby-constant">MySpace</span>.<span class="ruby-identifier">connection</span>.<span class="ruby-identifier">get_body</span>(<span class="ruby-identifier">path</span>)
306
+
307
+ <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@dataType</span> <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;Hash&quot;</span>
308
+ <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">json_to_obj</span>(<span class="ruby-identifier">body</span>)
309
+ <span class="ruby-keyword kw">elsif</span> <span class="ruby-ivar">@dataType</span> <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;Array&quot;</span>
310
+ <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">json_to_obj_collection</span>(<span class="ruby-identifier">body</span>)
311
+ <span class="ruby-keyword kw">else</span>
312
+ <span class="ruby-identifier">raise</span> <span class="ruby-constant">InvalidRequestParams</span>.<span class="ruby-identifier">new</span>(<span class="ruby-node">&quot;#{@dataType} is not a valid data type.&quot;</span>)
313
+ <span class="ruby-keyword kw">end</span>
314
+ <span class="ruby-keyword kw">end</span>
315
+ </pre>
316
+ </div>
317
+ </div>
318
+ </div>
319
+
320
+ <div id="method-M000051" class="method-detail">
321
+ <a name="M000051"></a>
322
+
323
+ <div class="method-heading">
324
+ <a href="#M000051" class="method-signature">
220
325
  <span class="method-name">get_raw</span><span class="method-args">(params,optParams=nil,format=&quot;json&quot;)</span>
221
326
  </a>
222
327
  </div>
@@ -226,8 +331,8 @@ and returns some <a href="../MySpace.html">MySpace</a> object
226
331
  Performs a request to the API servers and returns the raw JSON/XML
227
332
  </p>
228
333
  <p><a class="source-toggle" href="#"
229
- onclick="toggleCode('M000033-source');return false;">[Source]</a></p>
230
- <div class="method-source-code" id="M000033-source">
334
+ onclick="toggleCode('M000051-source');return false;">[Source]</a></p>
335
+ <div class="method-source-code" id="M000051-source">
231
336
  <pre>
232
337
  <span class="ruby-comment cmt"># File lib/myspace/object.rb, line 88</span>
233
338
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">get_raw</span>(<span class="ruby-identifier">params</span>,<span class="ruby-identifier">optParams</span>=<span class="ruby-keyword kw">nil</span>,<span class="ruby-identifier">format</span>=<span class="ruby-value str">&quot;json&quot;</span>)
@@ -239,11 +344,38 @@ Performs a request to the API servers and returns the raw JSON/XML
239
344
  </div>
240
345
  </div>
241
346
 
242
- <div id="method-M000030" class="method-detail">
243
- <a name="M000030"></a>
347
+ <div id="method-M000057" class="method-detail">
348
+ <a name="M000057"></a>
349
+
350
+ <div class="method-heading">
351
+ <a href="#M000057" class="method-signature">
352
+ <span class="method-name">get_raw</span><span class="method-args">(params,optParams=nil,format=&quot;json&quot;)</span>
353
+ </a>
354
+ </div>
355
+
356
+ <div class="method-description">
357
+ <p>
358
+ Performs a request to the API servers and returns the raw JSON/XML
359
+ </p>
360
+ <p><a class="source-toggle" href="#"
361
+ onclick="toggleCode('M000057-source');return false;">[Source]</a></p>
362
+ <div class="method-source-code" id="M000057-source">
363
+ <pre>
364
+ <span class="ruby-comment cmt"># File pkg/myspace-ruby-0.7.0/lib/myspace/object.rb, line 88</span>
365
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">get_raw</span>(<span class="ruby-identifier">params</span>,<span class="ruby-identifier">optParams</span>=<span class="ruby-keyword kw">nil</span>,<span class="ruby-identifier">format</span>=<span class="ruby-value str">&quot;json&quot;</span>)
366
+ <span class="ruby-identifier">path</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">build_request</span>(<span class="ruby-identifier">params</span>,<span class="ruby-identifier">optParams</span>,<span class="ruby-identifier">format</span>)
367
+ <span class="ruby-constant">MySpace</span>.<span class="ruby-identifier">connection</span>.<span class="ruby-identifier">get_body</span>(<span class="ruby-identifier">path</span>)
368
+ <span class="ruby-keyword kw">end</span>
369
+ </pre>
370
+ </div>
371
+ </div>
372
+ </div>
373
+
374
+ <div id="method-M000048" class="method-detail">
375
+ <a name="M000048"></a>
244
376
 
245
377
  <div class="method-heading">
246
- <a href="#M000030" class="method-signature">
378
+ <a href="#M000048" class="method-signature">
247
379
  <span class="method-name">json_to_obj</span><span class="method-args">(body)</span>
248
380
  </a>
249
381
  </div>
@@ -253,8 +385,8 @@ Performs a request to the API servers and returns the raw JSON/XML
253
385
  Attempts to convert JSON to <a href="../MySpace.html">MySpace</a> objects
254
386
  </p>
255
387
  <p><a class="source-toggle" href="#"
256
- onclick="toggleCode('M000030-source');return false;">[Source]</a></p>
257
- <div class="method-source-code" id="M000030-source">
388
+ onclick="toggleCode('M000048-source');return false;">[Source]</a></p>
389
+ <div class="method-source-code" id="M000048-source">
258
390
  <pre>
259
391
  <span class="ruby-comment cmt"># File lib/myspace/object.rb, line 25</span>
260
392
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">json_to_obj</span>(<span class="ruby-identifier">body</span>)
@@ -271,11 +403,43 @@ Attempts to convert JSON to <a href="../MySpace.html">MySpace</a> objects
271
403
  </div>
272
404
  </div>
273
405
 
274
- <div id="method-M000031" class="method-detail">
275
- <a name="M000031"></a>
406
+ <div id="method-M000054" class="method-detail">
407
+ <a name="M000054"></a>
408
+
409
+ <div class="method-heading">
410
+ <a href="#M000054" class="method-signature">
411
+ <span class="method-name">json_to_obj</span><span class="method-args">(body)</span>
412
+ </a>
413
+ </div>
414
+
415
+ <div class="method-description">
416
+ <p>
417
+ Attempts to convert JSON to <a href="../MySpace.html">MySpace</a> objects
418
+ </p>
419
+ <p><a class="source-toggle" href="#"
420
+ onclick="toggleCode('M000054-source');return false;">[Source]</a></p>
421
+ <div class="method-source-code" id="M000054-source">
422
+ <pre>
423
+ <span class="ruby-comment cmt"># File pkg/myspace-ruby-0.7.0/lib/myspace/object.rb, line 25</span>
424
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">json_to_obj</span>(<span class="ruby-identifier">body</span>)
425
+ <span class="ruby-keyword kw">begin</span>
426
+ <span class="ruby-identifier">obj</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">new</span>(<span class="ruby-constant">JSON</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-identifier">body</span>))
427
+ <span class="ruby-identifier">obj</span>.<span class="ruby-identifier">user</span> = <span class="ruby-constant">MySpace</span><span class="ruby-operator">::</span><span class="ruby-constant">User</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">obj</span>.<span class="ruby-identifier">user</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">obj</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-value str">&quot;user&quot;</span>)
428
+ <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Exception</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span>
429
+ <span class="ruby-identifier">raise</span> <span class="ruby-constant">InvalidResponse</span>, <span class="ruby-node">&quot;could not parse json from #{body}: '#{e}'&quot;</span>
430
+ <span class="ruby-keyword kw">end</span>
431
+ <span class="ruby-identifier">obj</span>
432
+ <span class="ruby-keyword kw">end</span>
433
+ </pre>
434
+ </div>
435
+ </div>
436
+ </div>
437
+
438
+ <div id="method-M000055" class="method-detail">
439
+ <a name="M000055"></a>
276
440
 
277
441
  <div class="method-heading">
278
- <a href="#M000031" class="method-signature">
442
+ <a href="#M000055" class="method-signature">
279
443
  <span class="method-name">json_to_obj_collection</span><span class="method-args">(body)</span>
280
444
  </a>
281
445
  </div>
@@ -286,8 +450,47 @@ Attempts to convert JSON to a <a href="../MySpace.html">MySpace</a> objects
286
450
  (with child collections)
287
451
  </p>
288
452
  <p><a class="source-toggle" href="#"
289
- onclick="toggleCode('M000031-source');return false;">[Source]</a></p>
290
- <div class="method-source-code" id="M000031-source">
453
+ onclick="toggleCode('M000055-source');return false;">[Source]</a></p>
454
+ <div class="method-source-code" id="M000055-source">
455
+ <pre>
456
+ <span class="ruby-comment cmt"># File pkg/myspace-ruby-0.7.0/lib/myspace/object.rb, line 36</span>
457
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">json_to_obj_collection</span>(<span class="ruby-identifier">body</span>)
458
+ <span class="ruby-keyword kw">begin</span>
459
+ <span class="ruby-identifier">obj</span> = <span class="ruby-identifier">json_to_obj</span>(<span class="ruby-identifier">body</span>)
460
+
461
+ <span class="ruby-identifier">col</span> = <span class="ruby-identifier">obj</span>.<span class="ruby-identifier">instance_variable_get</span> <span class="ruby-node">&quot;@#{@childBase}&quot;</span>
462
+ <span class="ruby-identifier">raise</span> <span class="ruby-constant">InvalidResponse</span>, <span class="ruby-node">&quot;No '#{@childBase}' in response&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">col</span>
463
+
464
+ <span class="ruby-identifier">col</span> = <span class="ruby-identifier">obj</span>.<span class="ruby-identifier">instance_variable_set</span> <span class="ruby-node">&quot;@#{@childBase}&quot;</span>,
465
+ <span class="ruby-identifier">col</span>.<span class="ruby-identifier">collect</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">o</span><span class="ruby-operator">|</span> <span class="ruby-identifier">eval</span>(<span class="ruby-node">&quot;#{@childType}.new(o)&quot;</span>) }
466
+
467
+ <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Exception</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span>
468
+ <span class="ruby-identifier">raise</span> <span class="ruby-constant">InvalidResponse</span>, <span class="ruby-node">&quot;could not parse json from #{body}: '#{e}'&quot;</span>
469
+ <span class="ruby-keyword kw">end</span>
470
+ <span class="ruby-identifier">obj</span>
471
+ <span class="ruby-keyword kw">end</span>
472
+ </pre>
473
+ </div>
474
+ </div>
475
+ </div>
476
+
477
+ <div id="method-M000049" class="method-detail">
478
+ <a name="M000049"></a>
479
+
480
+ <div class="method-heading">
481
+ <a href="#M000049" class="method-signature">
482
+ <span class="method-name">json_to_obj_collection</span><span class="method-args">(body)</span>
483
+ </a>
484
+ </div>
485
+
486
+ <div class="method-description">
487
+ <p>
488
+ Attempts to convert JSON to a <a href="../MySpace.html">MySpace</a> objects
489
+ (with child collections)
490
+ </p>
491
+ <p><a class="source-toggle" href="#"
492
+ onclick="toggleCode('M000049-source');return false;">[Source]</a></p>
493
+ <div class="method-source-code" id="M000049-source">
291
494
  <pre>
292
495
  <span class="ruby-comment cmt"># File lib/myspace/object.rb, line 36</span>
293
496
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">json_to_obj_collection</span>(<span class="ruby-identifier">body</span>)
@@ -310,19 +513,42 @@ Attempts to convert JSON to a <a href="../MySpace.html">MySpace</a> objects
310
513
  </div>
311
514
  </div>
312
515
 
313
- <div id="method-M000029" class="method-detail">
314
- <a name="M000029"></a>
516
+ <div id="method-M000053" class="method-detail">
517
+ <a name="M000053"></a>
518
+
519
+ <div class="method-heading">
520
+ <a href="#M000053" class="method-signature">
521
+ <span class="method-name">new</span><span class="method-args">(attribs={})</span>
522
+ </a>
523
+ </div>
524
+
525
+ <div class="method-description">
526
+ <p><a class="source-toggle" href="#"
527
+ onclick="toggleCode('M000053-source');return false;">[Source]</a></p>
528
+ <div class="method-source-code" id="M000053-source">
529
+ <pre>
530
+ <span class="ruby-comment cmt"># File pkg/myspace-ruby-0.7.0/lib/myspace/object.rb, line 19</span>
531
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">attribs</span>={})
532
+ <span class="ruby-identifier">attribs</span>.<span class="ruby-identifier">each</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">key</span>,<span class="ruby-identifier">val</span><span class="ruby-operator">|</span> <span class="ruby-identifier">instance_variable_set</span>(<span class="ruby-node">&quot;@#{key}&quot;</span>,<span class="ruby-identifier">val</span>) }
533
+ <span class="ruby-keyword kw">end</span>
534
+ </pre>
535
+ </div>
536
+ </div>
537
+ </div>
538
+
539
+ <div id="method-M000047" class="method-detail">
540
+ <a name="M000047"></a>
315
541
 
316
542
  <div class="method-heading">
317
- <a href="#M000029" class="method-signature">
543
+ <a href="#M000047" class="method-signature">
318
544
  <span class="method-name">new</span><span class="method-args">(attribs={})</span>
319
545
  </a>
320
546
  </div>
321
547
 
322
548
  <div class="method-description">
323
549
  <p><a class="source-toggle" href="#"
324
- onclick="toggleCode('M000029-source');return false;">[Source]</a></p>
325
- <div class="method-source-code" id="M000029-source">
550
+ onclick="toggleCode('M000047-source');return false;">[Source]</a></p>
551
+ <div class="method-source-code" id="M000047-source">
326
552
  <pre>
327
553
  <span class="ruby-comment cmt"># File lib/myspace/object.rb, line 19</span>
328
554
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">attribs</span>={})
@@ -58,6 +58,10 @@
58
58
  <a href="../../files/lib/myspace/classes/user_rb.html">
59
59
  lib/myspace/classes/user.rb
60
60
  </a>
61
+ <br />
62
+ <a href="../../files/pkg/myspace-ruby-0_7_0/lib/myspace/classes/user_rb.html">
63
+ pkg/myspace-ruby-0.7.0/lib/myspace/classes/user.rb
64
+ </a>
61
65
  <br />
62
66
  </td>
63
67
  </tr>
@@ -106,6 +110,29 @@
106
110
  <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
107
111
  <td class="context-item-desc"></td>
108
112
  </tr>
113
+ <tr class="top-aligned-row context-row">
114
+ <td class="context-item-name">image</td>
115
+ <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
116
+ <td class="context-item-desc"></td>
117
+ </tr>
118
+ <tr class="top-aligned-row context-row">
119
+ <td class="context-item-name">largeimage</td>
120
+ <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
121
+ <td class="context-item-desc"></td>
122
+ </tr>
123
+ <tr class="top-aligned-row context-row">
124
+ <td class="context-item-name">largeimage</td>
125
+ <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
126
+ <td class="context-item-desc"></td>
127
+ </tr>
128
+ <tr class="top-aligned-row context-row">
129
+ <td class="context-item-name">name</td>
130
+ <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
131
+ <td class="context-item-desc">
132
+ the name the user specified for the profile (not username/vanity url)
133
+
134
+ </td>
135
+ </tr>
109
136
  <tr class="top-aligned-row context-row">
110
137
  <td class="context-item-name">name</td>
111
138
  <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
@@ -119,6 +146,19 @@ the name the user specified for the profile (not username/vanity url)
119
146
  <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
120
147
  <td class="context-item-desc"></td>
121
148
  </tr>
149
+ <tr class="top-aligned-row context-row">
150
+ <td class="context-item-name">onlineNow</td>
151
+ <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
152
+ <td class="context-item-desc"></td>
153
+ </tr>
154
+ <tr class="top-aligned-row context-row">
155
+ <td class="context-item-name">uri</td>
156
+ <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
157
+ <td class="context-item-desc">
158
+ the URL of the user&#8216;s profile page
159
+
160
+ </td>
161
+ </tr>
122
162
  <tr class="top-aligned-row context-row">
123
163
  <td class="context-item-name">uri</td>
124
164
  <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
@@ -132,6 +172,16 @@ the URL of the user&#8216;s profile page
132
172
  <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
133
173
  <td class="context-item-desc"></td>
134
174
  </tr>
175
+ <tr class="top-aligned-row context-row">
176
+ <td class="context-item-name">userId</td>
177
+ <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
178
+ <td class="context-item-desc"></td>
179
+ </tr>
180
+ <tr class="top-aligned-row context-row">
181
+ <td class="context-item-name">userType</td>
182
+ <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
183
+ <td class="context-item-desc"></td>
184
+ </tr>
135
185
  <tr class="top-aligned-row context-row">
136
186
  <td class="context-item-name">userType</td>
137
187
  <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
@@ -142,6 +192,11 @@ the URL of the user&#8216;s profile page
142
192
  <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
143
193
  <td class="context-item-desc"></td>
144
194
  </tr>
195
+ <tr class="top-aligned-row context-row">
196
+ <td class="context-item-name">webUri</td>
197
+ <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
198
+ <td class="context-item-desc"></td>
199
+ </tr>
145
200
  </table>
146
201
  </div>
147
202
  </div>