stacked 0.5.0 → 1.0.0.beta1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (116) hide show
  1. data/.gitignore +3 -0
  2. data/Gemfile +3 -1
  3. data/Gemfile.lock +43 -0
  4. data/LICENSE +1 -1
  5. data/README.markdown +58 -25
  6. data/Rakefile +6 -45
  7. data/genddoc.sh +4 -1
  8. data/lib/stacked.rb +11 -9
  9. data/lib/stacked/answer.rb +10 -27
  10. data/lib/stacked/badge.rb +15 -11
  11. data/lib/stacked/base.rb +59 -92
  12. data/lib/stacked/client.rb +31 -0
  13. data/lib/stacked/comment.rb +13 -18
  14. data/lib/stacked/parser.rb +47 -0
  15. data/lib/stacked/post_timeline.rb +17 -0
  16. data/lib/stacked/question.rb +52 -51
  17. data/lib/stacked/{reputation.rb → rep_change.rb} +5 -3
  18. data/lib/stacked/tag.rb +10 -2
  19. data/lib/stacked/user.rb +29 -161
  20. data/lib/stacked/{usertimeline.rb → user_timeline.rb} +5 -5
  21. data/lib/stacked/version.rb +4 -0
  22. data/spec/fakes/answers/1237127 +0 -0
  23. data/spec/fakes/answers/2272830 +0 -0
  24. data/spec/fakes/answers/2558700 +0 -0
  25. data/spec/fakes/badges/index +0 -0
  26. data/spec/fakes/badges/name +0 -0
  27. data/spec/fakes/badges/tags +0 -0
  28. data/spec/fakes/comments/1063043 +0 -0
  29. data/spec/fakes/comments/2561833 +0 -0
  30. data/spec/fakes/questions/1236996 +0 -0
  31. data/spec/fakes/questions/1236996-answers +0 -0
  32. data/spec/fakes/questions/1236996-comments +0 -0
  33. data/spec/fakes/questions/1236996-timeline +0 -0
  34. data/spec/fakes/questions/4839321/answers +0 -0
  35. data/spec/fakes/questions/index +0 -0
  36. data/spec/fakes/questions/search +0 -0
  37. data/spec/fakes/questions/tagged +0 -0
  38. data/spec/fakes/questions/unanswered +0 -0
  39. data/spec/fakes/questions/withcomments +0 -0
  40. data/spec/fakes/stats/index +0 -0
  41. data/spec/fakes/tags/activity +0 -0
  42. data/spec/fakes/tags/index +0 -0
  43. data/spec/fakes/tags/name +0 -0
  44. data/spec/fakes/tags/popular +0 -0
  45. data/spec/fakes/users/148722 +0 -0
  46. data/spec/fakes/users/148722-comments +0 -0
  47. data/spec/fakes/users/148722-comments-by-creation +0 -0
  48. data/spec/fakes/users/148722-comments-by-votes +0 -0
  49. data/spec/fakes/users/22656 +0 -0
  50. data/spec/fakes/users/22656-answers +0 -0
  51. data/spec/fakes/users/22656-answers-by-activity +0 -0
  52. data/spec/fakes/users/22656-answers-by-creation +0 -0
  53. data/spec/fakes/users/22656-answers-by-views +0 -0
  54. data/spec/fakes/users/22656-answers-by-votes +0 -0
  55. data/spec/fakes/users/22656-badges +0 -0
  56. data/spec/fakes/users/22656-comments-mentioning-by-creation +0 -0
  57. data/spec/fakes/users/22656-comments-mentioning-by-votes +0 -0
  58. data/spec/fakes/users/22656-favorites +0 -0
  59. data/spec/fakes/users/22656-favorites-by-activity +0 -0
  60. data/spec/fakes/users/22656-favorites-by-added +0 -0
  61. data/spec/fakes/users/22656-favorites-by-creation +0 -0
  62. data/spec/fakes/users/22656-favorites-by-views +0 -0
  63. data/spec/fakes/users/22656-mentioned +0 -0
  64. data/spec/fakes/users/22656-questions +0 -0
  65. data/spec/fakes/users/22656-questions-by-activity +0 -0
  66. data/spec/fakes/users/22656-questions-by-creation +0 -0
  67. data/spec/fakes/users/22656-questions-by-views +0 -0
  68. data/spec/fakes/users/22656-questions-by-votes +0 -0
  69. data/spec/fakes/users/22656-reputation +0 -0
  70. data/spec/fakes/users/22656-reputation-ranged +0 -0
  71. data/spec/fakes/users/22656-tags +0 -0
  72. data/spec/fakes/users/22656-timeline +0 -0
  73. data/spec/fakes/users/filter +0 -0
  74. data/spec/fakes/users/index +0 -0
  75. data/spec/fakes/users/index-page2 +0 -0
  76. data/spec/fakes/users/index-pagesize1 +0 -0
  77. data/spec/fakes/users/name +0 -0
  78. data/spec/fakes/users/newest +0 -0
  79. data/spec/fakes/users/oldest +0 -0
  80. data/spec/sorted_by_spec.rb +2 -2
  81. data/spec/spec_helper.rb +10 -8
  82. data/spec/stacked/answer_spec.rb +9 -8
  83. data/spec/stacked/badge_spec.rb +11 -3
  84. data/spec/stacked/base_spec.rb +24 -2
  85. data/spec/stacked/comment_spec.rb +11 -9
  86. data/spec/stacked/question_spec.rb +49 -61
  87. data/spec/stacked/{reputation_spec.rb → rep_change_spec.rb} +9 -5
  88. data/spec/stacked/tag_spec.rb +13 -6
  89. data/spec/stacked/user_spec.rb +99 -70
  90. data/spec/stacked/{usertimeline_spec.rb → user_timeline_spec.rb} +1 -1
  91. data/spec/support/fakes.rb +28 -0
  92. data/spec/support/{sorted_by.rb → matchers/sorted_by.rb} +7 -6
  93. data/spec/support/{within.rb → matchers/within.rb} +3 -3
  94. data/spec/within_spec.rb +2 -2
  95. data/stacked.gemspec +23 -112
  96. metadata +248 -54
  97. data/README.rdoc +0 -18
  98. data/VERSION +0 -1
  99. data/doc/Stacked.html +0 -155
  100. data/doc/Stacked/Answer.html +0 -1394
  101. data/doc/Stacked/Badge.html +0 -480
  102. data/doc/Stacked/Base.html +0 -1124
  103. data/doc/Stacked/Comment.html +0 -1037
  104. data/doc/Stacked/NotImplemented.html +0 -162
  105. data/doc/Stacked/Posttimeline.html +0 -543
  106. data/doc/Stacked/Question.html +0 -1763
  107. data/doc/Stacked/Reputation.html +0 -606
  108. data/doc/Stacked/Tag.html +0 -267
  109. data/doc/Stacked/User.html +0 -2787
  110. data/doc/Stacked/Usertimeline.html +0 -630
  111. data/doc/_index.html +0 -246
  112. data/doc/file.README.html +0 -54
  113. data/doc/index.html +0 -54
  114. data/doc/method_list.html +0 -1203
  115. data/doc/top-level-namespace.html +0 -87
  116. data/lib/stacked/posttimeline.rb +0 -10
@@ -1,1124 +0,0 @@
1
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
- <head>
5
- <meta name="Content-Type" content="text/html; charset=utf-8" />
6
- <title>Class: Stacked::Base</title>
7
- <link rel="stylesheet" href="../css/style.css" type="text/css" media="screen" charset="utf-8" />
8
- <link rel="stylesheet" href="../css/common.css" type="text/css" media="screen" charset="utf-8" />
9
-
10
- <script type="text/javascript" charset="utf-8">
11
- relpath = '..';
12
- if (relpath != '') relpath += '/';
13
- </script>
14
- <script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
15
- <script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
16
-
17
- </head>
18
- <body>
19
- <script type="text/javascript" charset="utf-8">
20
- if (window.top.frames.main) document.body.className = 'frames';
21
- </script>
22
-
23
- <div id="header">
24
- <div id="menu">
25
-
26
- <a href="../_index.html">Index (B)</a> &raquo;
27
- <span class='title'><a href="../Stacked.html" title="Stacked (module)">Stacked</a></span>
28
- &raquo;
29
- <span class="title">Base</span>
30
-
31
-
32
- <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
33
- </div>
34
-
35
- <div id="search">
36
- <a id="class_list_link" href="#">Class List</a>
37
- <a id="method_list_link" href="#">Method List</a>
38
- <a id ="file_list_link" href="#">File List</a>
39
- </div>
40
-
41
- <div class="clear"></div>
42
- </div>
43
-
44
- <iframe id="search_frame"></iframe>
45
-
46
- <div id="content"><h1>Class: Stacked::Base
47
-
48
-
49
- </h1>
50
-
51
- <dl class="box">
52
-
53
- <dt class="r1">Inherits:</dt>
54
- <dd class="r1">
55
- <span class="inheritName">Object</span>
56
-
57
- <ul class="fullTree">
58
- <li>Object</li>
59
-
60
- <li class="next">Stacked::Base</li>
61
-
62
- </ul>
63
- <a href="#" class="inheritanceTree">show all</a>
64
-
65
- </dd>
66
-
67
-
68
-
69
-
70
-
71
-
72
- <dt class="r2">Includes:</dt>
73
- <dd class="r2">HTTParty</dd>
74
-
75
-
76
-
77
-
78
-
79
- <dt class="r1 last">Defined in:</dt>
80
- <dd class="r1 last">lib/stacked/base.rb</dd>
81
-
82
- </dl>
83
- <div class="clear"></div>
84
-
85
- <div id="subclasses">
86
- <h2>Direct Known Subclasses</h2>
87
- <p class="children"><a href="Answer.html" title="Stacked::Answer (class)">Answer</a>, <a href="Badge.html" title="Stacked::Badge (class)">Badge</a>, <a href="Comment.html" title="Stacked::Comment (class)">Comment</a>, <a href="Posttimeline.html" title="Stacked::Posttimeline (class)">Posttimeline</a>, <a href="Question.html" title="Stacked::Question (class)">Question</a>, <a href="Reputation.html" title="Stacked::Reputation (class)">Reputation</a>, <a href="Tag.html" title="Stacked::Tag (class)">Tag</a>, <a href="User.html" title="Stacked::User (class)">User</a>, <a href="Usertimeline.html" title="Stacked::Usertimeline (class)">Usertimeline</a></p>
88
- </div>
89
-
90
-
91
-
92
-
93
-
94
- <h2>Class Method Summary</h2>
95
-
96
- <ul class="summary">
97
-
98
- <li class="public ">
99
- <span class="summary_signature">
100
-
101
- <a href="#all-class_method" title="all (class method)">+ (Object) <strong>all</strong>(options = {}) </a>
102
-
103
-
104
-
105
- </span>
106
-
107
-
108
-
109
-
110
-
111
-
112
-
113
- <span class="summary_desc"><div class='inline'></div></span>
114
-
115
- </li>
116
-
117
-
118
- <li class="public ">
119
- <span class="summary_signature">
120
-
121
- <a href="#association-class_method" title="association (class method)">+ (Object) <strong>association</strong>(assoc) </a>
122
-
123
-
124
-
125
- </span>
126
-
127
-
128
-
129
-
130
-
131
-
132
-
133
- <span class="summary_desc"><div class='inline'></div></span>
134
-
135
- </li>
136
-
137
-
138
- <li class="public ">
139
- <span class="summary_signature">
140
-
141
- <a href="#collection-class_method" title="collection (class method)">+ (Object) <strong>collection</strong>(*names) </a>
142
-
143
-
144
-
145
- </span>
146
-
147
-
148
-
149
-
150
-
151
-
152
-
153
- <span class="summary_desc"><div class='inline'><p>
154
- Define collection methods, such as newest.
155
- </p>
156
- </div></span>
157
-
158
- </li>
159
-
160
-
161
- <li class="public ">
162
- <span class="summary_signature">
163
-
164
- <a href="#find-class_method" title="find (class method)">+ (Object) <strong>find</strong>(id, options = {}) </a>
165
-
166
-
167
-
168
- </span>
169
-
170
-
171
-
172
-
173
-
174
-
175
-
176
- <span class="summary_desc"><div class='inline'></div></span>
177
-
178
- </li>
179
-
180
-
181
- <li class="public ">
182
- <span class="summary_signature">
183
-
184
- <a href="#records-class_method" title="records (class method)">+ (Object) <strong>records</strong>(p = path, options = {}) </a>
185
-
186
-
187
-
188
- </span>
189
-
190
-
191
-
192
-
193
-
194
-
195
-
196
- <span class="summary_desc"><div class='inline'></div></span>
197
-
198
- </li>
199
-
200
-
201
- <li class="public ">
202
- <span class="summary_signature">
203
-
204
- <a href="#request-class_method" title="request (class method)">+ (Object) <strong>request</strong>(p = path, options = {}) </a>
205
-
206
-
207
-
208
- </span>
209
-
210
-
211
-
212
-
213
-
214
-
215
-
216
- <span class="summary_desc"><div class='inline'></div></span>
217
-
218
- </li>
219
-
220
-
221
- <li class="public ">
222
- <span class="summary_signature">
223
-
224
- <a href="#singular-class_method" title="singular (class method)">+ (Object) <strong>singular</strong>(id) </a>
225
-
226
-
227
-
228
- </span>
229
-
230
-
231
-
232
-
233
-
234
-
235
-
236
- <span class="summary_desc"><div class='inline'></div></span>
237
-
238
- </li>
239
-
240
-
241
- <li class="public ">
242
- <span class="summary_signature">
243
-
244
- <a href="#stats-class_method" title="stats (class method)">+ (Object) <strong>stats</strong> </a>
245
-
246
-
247
-
248
- </span>
249
-
250
-
251
-
252
-
253
-
254
-
255
-
256
- <span class="summary_desc"><div class='inline'></div></span>
257
-
258
- </li>
259
-
260
-
261
- </ul>
262
-
263
- <h2>Instance Method Summary</h2>
264
-
265
- <ul class="summary">
266
-
267
- <li class="public ">
268
- <span class="summary_signature">
269
-
270
- <a href="#initialize-instance_method" title="#initialize (instance method)">- (Base) <strong>initialize</strong>(attributes) </a>
271
-
272
-
273
-
274
- </span>
275
-
276
- <span class="note title constructor">constructor</span>
277
-
278
-
279
-
280
-
281
-
282
-
283
-
284
- <span class="summary_desc"><div class='inline'><p>
285
- A new instance of Base.
286
- </p>
287
- </div></span>
288
-
289
- </li>
290
-
291
-
292
- <li class="public ">
293
- <span class="summary_signature">
294
-
295
- <a href="#parse_answers-instance_method" title="#parse_answers (instance method)">- (Object) <strong>parse_answers</strong>(result) </a>
296
-
297
-
298
-
299
- </span>
300
-
301
-
302
-
303
-
304
-
305
-
306
-
307
- <span class="summary_desc"><div class='inline'></div></span>
308
-
309
- </li>
310
-
311
-
312
- <li class="public ">
313
- <span class="summary_signature">
314
-
315
- <a href="#parse_badges-instance_method" title="#parse_badges (instance method)">- (Object) <strong>parse_badges</strong>(result) </a>
316
-
317
-
318
-
319
- </span>
320
-
321
-
322
-
323
-
324
-
325
-
326
-
327
- <span class="summary_desc"><div class='inline'></div></span>
328
-
329
- </li>
330
-
331
-
332
- <li class="public ">
333
- <span class="summary_signature">
334
-
335
- <a href="#parse_comments-instance_method" title="#parse_comments (instance method)">- (Object) <strong>parse_comments</strong>(result) </a>
336
-
337
-
338
-
339
- </span>
340
-
341
-
342
-
343
-
344
-
345
-
346
-
347
- <span class="summary_desc"><div class='inline'></div></span>
348
-
349
- </li>
350
-
351
-
352
- <li class="public ">
353
- <span class="summary_signature">
354
-
355
- <a href="#parse_post_timeline-instance_method" title="#parse_post_timeline (instance method)">- (Object) <strong>parse_post_timeline</strong>(result) </a>
356
-
357
-
358
-
359
- </span>
360
-
361
-
362
-
363
-
364
-
365
-
366
-
367
- <span class="summary_desc"><div class='inline'></div></span>
368
-
369
- </li>
370
-
371
-
372
- <li class="public ">
373
- <span class="summary_signature">
374
-
375
- <a href="#parse_questions-instance_method" title="#parse_questions (instance method)">- (Object) <strong>parse_questions</strong>(result) </a>
376
-
377
-
378
-
379
- </span>
380
-
381
-
382
-
383
-
384
-
385
-
386
-
387
- <span class="summary_desc"><div class='inline'></div></span>
388
-
389
- </li>
390
-
391
-
392
- <li class="public ">
393
- <span class="summary_signature">
394
-
395
- <a href="#parse_reputations-instance_method" title="#parse_reputations (instance method)">- (Object) <strong>parse_reputations</strong>(result) </a>
396
-
397
-
398
-
399
- </span>
400
-
401
-
402
-
403
-
404
-
405
-
406
-
407
- <span class="summary_desc"><div class='inline'></div></span>
408
-
409
- </li>
410
-
411
-
412
- <li class="public ">
413
- <span class="summary_signature">
414
-
415
- <a href="#parse_tags-instance_method" title="#parse_tags (instance method)">- (Object) <strong>parse_tags</strong>(result) </a>
416
-
417
-
418
-
419
- </span>
420
-
421
-
422
-
423
-
424
-
425
-
426
-
427
- <span class="summary_desc"><div class='inline'></div></span>
428
-
429
- </li>
430
-
431
-
432
- <li class="public ">
433
- <span class="summary_signature">
434
-
435
- <a href="#parse_type-instance_method" title="#parse_type (instance method)">- (Object) <strong>parse_type</strong>(result, type) </a>
436
-
437
-
438
-
439
- </span>
440
-
441
-
442
-
443
-
444
-
445
-
446
-
447
- <span class="summary_desc"><div class='inline'></div></span>
448
-
449
- </li>
450
-
451
-
452
- <li class="public ">
453
- <span class="summary_signature">
454
-
455
- <a href="#parse_user_timeline-instance_method" title="#parse_user_timeline (instance method)">- (Object) <strong>parse_user_timeline</strong>(result) </a>
456
-
457
-
458
-
459
- </span>
460
-
461
-
462
-
463
-
464
-
465
-
466
-
467
- <span class="summary_desc"><div class='inline'></div></span>
468
-
469
- </li>
470
-
471
-
472
- <li class="public ">
473
- <span class="summary_signature">
474
-
475
- <a href="#post-instance_method" title="#post (instance method)">- (Object) <strong>post</strong> </a>
476
-
477
-
478
-
479
- </span>
480
-
481
-
482
-
483
-
484
-
485
-
486
-
487
- <span class="summary_desc"><div class='inline'></div></span>
488
-
489
- </li>
490
-
491
-
492
- </ul>
493
-
494
-
495
-
496
- <div id="constructor_details" class="method_details_list">
497
- <h2>Constructor Details</h2>
498
-
499
- <div class="method_details first">
500
- <p class="signature first" id="initialize-instance_method">
501
-
502
- - (<tt><a href="" title="Stacked::Base (class)">Base</a></tt>) <strong>initialize</strong>(attributes)
503
-
504
-
505
-
506
- </p><div class="docstring">
507
- <div class="discussion">
508
- <p>
509
- A new instance of Base
510
- </p>
511
-
512
-
513
- </div>
514
- </div>
515
- <div class="tags">
516
-
517
- </div><table class="source_code">
518
- <tr>
519
- <td>
520
- <pre class="lines">
521
-
522
-
523
- 126
524
- 127
525
- 128
526
- 129
527
- 130
528
- 131
529
- 132</pre>
530
- </td>
531
- <td>
532
- <pre class="code"><span class="info file"># File 'lib/stacked/base.rb', line 126</span>
533
-
534
- <span class='def def kw'>def</span> <span class='initialize identifier id'>initialize</span><span class='lparen token'>(</span><span class='attributes identifier id'>attributes</span><span class='rparen token'>)</span>
535
- <span class='comment val'># p self</span>
536
- <span class='comment val'># p attributes.keys.sort.map { |t| t.to_sym }</span>
537
- <span class='attributes identifier id'>attributes</span><span class='dot token'>.</span><span class='each identifier id'>each</span> <span class='do do kw'>do</span> <span class='bitor op'>|</span><span class='k identifier id'>k</span><span class='comma token'>,</span> <span class='v identifier id'>v</span><span class='bitor op'>|</span>
538
- <span class='self self kw'>self</span><span class='dot token'>.</span><span class='send identifier id'>send</span><span class='lparen token'>(</span><span class='dstring node'>&quot;#{k}=&quot;</span><span class='comma token'>,</span> <span class='v identifier id'>v</span><span class='rparen token'>)</span>
539
- <span class='end end kw'>end</span>
540
- <span class='end end kw'>end</span>
541
- </pre>
542
- </td>
543
- </tr>
544
- </table>
545
- </div>
546
-
547
- </div>
548
-
549
-
550
- <div id="class_method_details" class="method_details_list">
551
- <h2>Class Method Details</h2>
552
-
553
-
554
- <div class="method_details first">
555
- <p class="signature first" id="all-class_method">
556
-
557
- + (<tt>Object</tt>) <strong>all</strong>(options = {})
558
-
559
-
560
-
561
- </p><table class="source_code">
562
- <tr>
563
- <td>
564
- <pre class="lines">
565
-
566
-
567
- 16
568
- 17
569
- 18</pre>
570
- </td>
571
- <td>
572
- <pre class="code"><span class="info file"># File 'lib/stacked/base.rb', line 16</span>
573
-
574
- <span class='def def kw'>def</span> <span class='all identifier id'>all</span><span class='lparen token'>(</span><span class='options identifier id'>options</span> <span class='assign token'>=</span> <span class='lbrace token'>{</span><span class='rbrace token'>}</span><span class='rparen token'>)</span>
575
- <span class='records identifier id'>records</span><span class='lparen token'>(</span><span class='path identifier id'>path</span><span class='comma token'>,</span> <span class='options identifier id'>options</span><span class='rparen token'>)</span>
576
- <span class='end end kw'>end</span>
577
- </pre>
578
- </td>
579
- </tr>
580
- </table>
581
- </div>
582
-
583
- <div class="method_details ">
584
- <p class="signature " id="association-class_method">
585
-
586
- + (<tt>Object</tt>) <strong>association</strong>(assoc)
587
-
588
-
589
-
590
- </p><table class="source_code">
591
- <tr>
592
- <td>
593
- <pre class="lines">
594
-
595
-
596
- 45
597
- 46
598
- 47
599
- 48
600
- 49
601
- 50
602
- 51
603
- 52
604
- 53
605
- 54</pre>
606
- </td>
607
- <td>
608
- <pre class="code"><span class="info file"># File 'lib/stacked/base.rb', line 45</span>
609
-
610
- <span class='def def kw'>def</span> <span class='association identifier id'>association</span><span class='lparen token'>(</span><span class='assoc identifier id'>assoc</span><span class='rparen token'>)</span>
611
- <span class='instance_eval identifier id'>instance_eval</span> <span class='do do kw'>do</span>
612
- <span class='assoc identifier id'>assoc</span> <span class='assign token'>=</span> <span class='assoc identifier id'>assoc</span><span class='dot token'>.</span><span class='to_s identifier id'>to_s</span>
613
- <span class='define_method identifier id'>define_method</span><span class='lparen token'>(</span><span class='dstring node'>&quot;#{assoc}=&quot;</span><span class='rparen token'>)</span> <span class='do do kw'>do</span> <span class='bitor op'>|</span><span class='records identifier id'>records</span><span class='bitor op'>|</span>
614
- <span class='instance_variable_set identifier id'>instance_variable_set</span><span class='lparen token'>(</span><span class='dstring node'>&quot;@#{assoc}&quot;</span><span class='comma token'>,</span> <span class='records identifier id'>records</span><span class='dot token'>.</span><span class='map identifier id'>map</span> <span class='lbrace token'>{</span> <span class='bitor op'>|</span><span class='record identifier id'>record</span><span class='bitor op'>|</span> <span class='dstring node'>&quot;Stacked::#{assoc.classify}&quot;</span><span class='dot token'>.</span><span class='constantize identifier id'>constantize</span><span class='dot token'>.</span><span class='new identifier id'>new</span><span class='lparen token'>(</span><span class='record identifier id'>record</span><span class='rparen token'>)</span> <span class='rbrace token'>}</span><span class='rparen token'>)</span>
615
- <span class='end end kw'>end</span>
616
-
617
- <span class='define_method identifier id'>define_method</span><span class='lparen token'>(</span><span class='assoc identifier id'>assoc</span><span class='rparen token'>)</span> <span class='lbrace token'>{</span> <span class='instance_variable_get identifier id'>instance_variable_get</span><span class='lparen token'>(</span><span class='dstring node'>&quot;@#{assoc}&quot;</span><span class='rparen token'>)</span> <span class='rbrace token'>}</span>
618
- <span class='end end kw'>end</span>
619
- <span class='end end kw'>end</span>
620
- </pre>
621
- </td>
622
- </tr>
623
- </table>
624
- </div>
625
-
626
- <div class="method_details ">
627
- <p class="signature " id="collection-class_method">
628
-
629
- + (<tt>Object</tt>) <strong>collection</strong>(*names)
630
-
631
-
632
-
633
- </p><div class="docstring">
634
- <div class="discussion">
635
- <p>
636
- Define collection methods, such as newest.
637
- </p>
638
-
639
-
640
- </div>
641
- </div>
642
- <div class="tags">
643
-
644
- </div><table class="source_code">
645
- <tr>
646
- <td>
647
- <pre class="lines">
648
-
649
-
650
- 33
651
- 34
652
- 35
653
- 36
654
- 37
655
- 38</pre>
656
- </td>
657
- <td>
658
- <pre class="code"><span class="info file"># File 'lib/stacked/base.rb', line 33</span>
659
-
660
- <span class='def def kw'>def</span> <span class='collection identifier id'>collection</span><span class='lparen token'>(</span><span class='mult op'>*</span><span class='names identifier id'>names</span><span class='rparen token'>)</span>
661
- <span class='comment val'># Forgive me Matz for I have sinned.</span>
662
- <span class='for for kw'>for</span> <span class='name identifier id'>name</span> <span class='in in kw'>in</span> <span class='names identifier id'>names</span>
663
- <span class='eval identifier id'>eval</span> <span class='string val'>&quot;def self.\#{name}(options = {})\nrecords(path + \&quot;\#{name}\&quot;, options)\nend\n&quot;</span>
664
- <span class='end end kw'>end</span>
665
- <span class='end end kw'>end</span>
666
- </pre>
667
- </td>
668
- </tr>
669
- </table>
670
- </div>
671
-
672
- <div class="method_details ">
673
- <p class="signature " id="find-class_method">
674
-
675
- + (<tt>Object</tt>) <strong>find</strong>(id, options = {})
676
-
677
-
678
-
679
- </p><table class="source_code">
680
- <tr>
681
- <td>
682
- <pre class="lines">
683
-
684
-
685
- 20
686
- 21
687
- 22</pre>
688
- </td>
689
- <td>
690
- <pre class="code"><span class="info file"># File 'lib/stacked/base.rb', line 20</span>
691
-
692
- <span class='def def kw'>def</span> <span class='find identifier id'>find</span><span class='lparen token'>(</span><span class='id identifier id'>id</span><span class='comma token'>,</span> <span class='options identifier id'>options</span><span class='assign token'>=</span><span class='lbrace token'>{</span><span class='rbrace token'>}</span><span class='rparen token'>)</span>
693
- <span class='self self kw'>self</span><span class='dot token'>.</span><span class='new identifier id'>new</span><span class='lparen token'>(</span><span class='request identifier id'>request</span><span class='lparen token'>(</span><span class='singular identifier id'>singular</span><span class='lparen token'>(</span><span class='id identifier id'>id</span><span class='rparen token'>)</span><span class='comma token'>,</span> <span class='options identifier id'>options</span><span class='rparen token'>)</span><span class='lbrack token'>[</span><span class='resource identifier id'>resource</span><span class='dot token'>.</span><span class='singularize identifier id'>singularize</span><span class='rbrack token'>]</span><span class='rparen token'>)</span>
694
- <span class='end end kw'>end</span>
695
- </pre>
696
- </td>
697
- </tr>
698
- </table>
699
- </div>
700
-
701
- <div class="method_details ">
702
- <p class="signature " id="records-class_method">
703
-
704
- + (<tt>Object</tt>) <strong>records</strong>(p = path, options = {})
705
-
706
-
707
-
708
- </p><table class="source_code">
709
- <tr>
710
- <td>
711
- <pre class="lines">
712
-
713
-
714
- 24
715
- 25
716
- 26</pre>
717
- </td>
718
- <td>
719
- <pre class="code"><span class="info file"># File 'lib/stacked/base.rb', line 24</span>
720
-
721
- <span class='def def kw'>def</span> <span class='records identifier id'>records</span><span class='lparen token'>(</span><span class='p identifier id'>p</span> <span class='assign token'>=</span> <span class='path identifier id'>path</span><span class='comma token'>,</span> <span class='options identifier id'>options</span> <span class='assign token'>=</span> <span class='lbrace token'>{</span><span class='rbrace token'>}</span><span class='rparen token'>)</span>
722
- <span class='parse identifier id'>parse</span><span class='lparen token'>(</span><span class='request identifier id'>request</span><span class='lparen token'>(</span><span class='p identifier id'>p</span><span class='comma token'>,</span> <span class='options identifier id'>options</span><span class='rparen token'>)</span><span class='lbrack token'>[</span><span class='resource identifier id'>resource</span><span class='rbrack token'>]</span><span class='rparen token'>)</span>
723
- <span class='end end kw'>end</span>
724
- </pre>
725
- </td>
726
- </tr>
727
- </table>
728
- </div>
729
-
730
- <div class="method_details ">
731
- <p class="signature " id="request-class_method">
732
-
733
- + (<tt>Object</tt>) <strong>request</strong>(p = path, options = {})
734
-
735
-
736
-
737
- </p><table class="source_code">
738
- <tr>
739
- <td>
740
- <pre class="lines">
741
-
742
-
743
- 28
744
- 29
745
- 30</pre>
746
- </td>
747
- <td>
748
- <pre class="code"><span class="info file"># File 'lib/stacked/base.rb', line 28</span>
749
-
750
- <span class='def def kw'>def</span> <span class='request identifier id'>request</span><span class='lparen token'>(</span><span class='p identifier id'>p</span> <span class='assign token'>=</span> <span class='path identifier id'>path</span><span class='comma token'>,</span> <span class='options identifier id'>options</span> <span class='assign token'>=</span> <span class='lbrace token'>{</span><span class='rbrace token'>}</span><span class='rparen token'>)</span>
751
- <span class='get identifier id'>get</span><span class='lparen token'>(</span><span class='p identifier id'>p</span><span class='comma token'>,</span> <span class='symbol val'>:query</span> <span class='assign token'>=</span><span class='gt op'>&gt;</span> <span class='lbrace token'>{</span> <span class='symbol val'>:key</span> <span class='assign token'>=</span><span class='gt op'>&gt;</span> <span class='key identifier id'>key</span> <span class='rbrace token'>}</span><span class='dot token'>.</span><span class='merge! fid id'>merge!</span><span class='lparen token'>(</span><span class='options identifier id'>options</span><span class='rparen token'>)</span><span class='rparen token'>)</span>
752
- <span class='end end kw'>end</span>
753
- </pre>
754
- </td>
755
- </tr>
756
- </table>
757
- </div>
758
-
759
- <div class="method_details ">
760
- <p class="signature " id="singular-class_method">
761
-
762
- + (<tt>Object</tt>) <strong>singular</strong>(id)
763
-
764
-
765
-
766
- </p><table class="source_code">
767
- <tr>
768
- <td>
769
- <pre class="lines">
770
-
771
-
772
- 56
773
- 57
774
- 58</pre>
775
- </td>
776
- <td>
777
- <pre class="code"><span class="info file"># File 'lib/stacked/base.rb', line 56</span>
778
-
779
- <span class='def def kw'>def</span> <span class='singular identifier id'>singular</span><span class='lparen token'>(</span><span class='id identifier id'>id</span><span class='rparen token'>)</span>
780
- <span class='path identifier id'>path</span> <span class='plus op'>+</span> <span class='id identifier id'>id</span><span class='dot token'>.</span><span class='to_s identifier id'>to_s</span>
781
- <span class='end end kw'>end</span>
782
- </pre>
783
- </td>
784
- </tr>
785
- </table>
786
- </div>
787
-
788
- <div class="method_details ">
789
- <p class="signature " id="stats-class_method">
790
-
791
- + (<tt>Object</tt>) <strong>stats</strong>
792
-
793
-
794
-
795
- </p><table class="source_code">
796
- <tr>
797
- <td>
798
- <pre class="lines">
799
-
800
-
801
- 12
802
- 13
803
- 14</pre>
804
- </td>
805
- <td>
806
- <pre class="code"><span class="info file"># File 'lib/stacked/base.rb', line 12</span>
807
-
808
- <span class='def def kw'>def</span> <span class='stats identifier id'>stats</span>
809
- <span class='request identifier id'>request</span><span class='lparen token'>(</span><span class='base identifier id'>base</span> <span class='plus op'>+</span> <span class='string val'>&quot;stats&quot;</span><span class='rparen token'>)</span><span class='lbrack token'>[</span><span class='string val'>&quot;stats&quot;</span><span class='rbrack token'>]</span>
810
- <span class='end end kw'>end</span>
811
- </pre>
812
- </td>
813
- </tr>
814
- </table>
815
- </div>
816
-
817
- </div>
818
-
819
- <div id="instance_method_details" class="method_details_list">
820
- <h2>Instance Method Details</h2>
821
-
822
-
823
- <div class="method_details first">
824
- <p class="signature first" id="parse_answers-instance_method">
825
-
826
- - (<tt>Object</tt>) <strong>parse_answers</strong>(result)
827
-
828
-
829
-
830
- </p><table class="source_code">
831
- <tr>
832
- <td>
833
- <pre class="lines">
834
-
835
-
836
- 84
837
- 85
838
- 86</pre>
839
- </td>
840
- <td>
841
- <pre class="code"><span class="info file"># File 'lib/stacked/base.rb', line 84</span>
842
-
843
- <span class='def def kw'>def</span> <span class='parse_answers identifier id'>parse_answers</span><span class='lparen token'>(</span><span class='result identifier id'>result</span><span class='rparen token'>)</span>
844
- <span class='parse_type identifier id'>parse_type</span><span class='lparen token'>(</span><span class='result identifier id'>result</span><span class='comma token'>,</span> <span class='string val'>&quot;answer&quot;</span><span class='rparen token'>)</span>
845
- <span class='end end kw'>end</span>
846
- </pre>
847
- </td>
848
- </tr>
849
- </table>
850
- </div>
851
-
852
- <div class="method_details ">
853
- <p class="signature " id="parse_badges-instance_method">
854
-
855
- - (<tt>Object</tt>) <strong>parse_badges</strong>(result)
856
-
857
-
858
-
859
- </p><table class="source_code">
860
- <tr>
861
- <td>
862
- <pre class="lines">
863
-
864
-
865
- 88
866
- 89
867
- 90</pre>
868
- </td>
869
- <td>
870
- <pre class="code"><span class="info file"># File 'lib/stacked/base.rb', line 88</span>
871
-
872
- <span class='def def kw'>def</span> <span class='parse_badges identifier id'>parse_badges</span><span class='lparen token'>(</span><span class='result identifier id'>result</span><span class='rparen token'>)</span>
873
- <span class='parse_type identifier id'>parse_type</span><span class='lparen token'>(</span><span class='result identifier id'>result</span><span class='comma token'>,</span> <span class='string val'>&quot;badge&quot;</span><span class='rparen token'>)</span>
874
- <span class='end end kw'>end</span>
875
- </pre>
876
- </td>
877
- </tr>
878
- </table>
879
- </div>
880
-
881
- <div class="method_details ">
882
- <p class="signature " id="parse_comments-instance_method">
883
-
884
- - (<tt>Object</tt>) <strong>parse_comments</strong>(result)
885
-
886
-
887
-
888
- </p><table class="source_code">
889
- <tr>
890
- <td>
891
- <pre class="lines">
892
-
893
-
894
- 92
895
- 93
896
- 94</pre>
897
- </td>
898
- <td>
899
- <pre class="code"><span class="info file"># File 'lib/stacked/base.rb', line 92</span>
900
-
901
- <span class='def def kw'>def</span> <span class='parse_comments identifier id'>parse_comments</span><span class='lparen token'>(</span><span class='result identifier id'>result</span><span class='rparen token'>)</span>
902
- <span class='parse_type identifier id'>parse_type</span><span class='lparen token'>(</span><span class='result identifier id'>result</span><span class='comma token'>,</span> <span class='string val'>&quot;comment&quot;</span><span class='rparen token'>)</span>
903
- <span class='end end kw'>end</span>
904
- </pre>
905
- </td>
906
- </tr>
907
- </table>
908
- </div>
909
-
910
- <div class="method_details ">
911
- <p class="signature " id="parse_post_timeline-instance_method">
912
-
913
- - (<tt>Object</tt>) <strong>parse_post_timeline</strong>(result)
914
-
915
-
916
-
917
- </p><table class="source_code">
918
- <tr>
919
- <td>
920
- <pre class="lines">
921
-
922
-
923
- 96
924
- 97
925
- 98</pre>
926
- </td>
927
- <td>
928
- <pre class="code"><span class="info file"># File 'lib/stacked/base.rb', line 96</span>
929
-
930
- <span class='def def kw'>def</span> <span class='parse_post_timeline identifier id'>parse_post_timeline</span><span class='lparen token'>(</span><span class='result identifier id'>result</span><span class='rparen token'>)</span>
931
- <span class='parse_type identifier id'>parse_type</span><span class='lparen token'>(</span><span class='result identifier id'>result</span><span class='comma token'>,</span> <span class='string val'>&quot;posttimeline&quot;</span><span class='rparen token'>)</span>
932
- <span class='end end kw'>end</span>
933
- </pre>
934
- </td>
935
- </tr>
936
- </table>
937
- </div>
938
-
939
- <div class="method_details ">
940
- <p class="signature " id="parse_questions-instance_method">
941
-
942
- - (<tt>Object</tt>) <strong>parse_questions</strong>(result)
943
-
944
-
945
-
946
- </p><table class="source_code">
947
- <tr>
948
- <td>
949
- <pre class="lines">
950
-
951
-
952
- 100
953
- 101
954
- 102</pre>
955
- </td>
956
- <td>
957
- <pre class="code"><span class="info file"># File 'lib/stacked/base.rb', line 100</span>
958
-
959
- <span class='def def kw'>def</span> <span class='parse_questions identifier id'>parse_questions</span><span class='lparen token'>(</span><span class='result identifier id'>result</span><span class='rparen token'>)</span>
960
- <span class='parse_type identifier id'>parse_type</span><span class='lparen token'>(</span><span class='result identifier id'>result</span><span class='comma token'>,</span> <span class='string val'>&quot;question&quot;</span><span class='rparen token'>)</span>
961
- <span class='end end kw'>end</span>
962
- </pre>
963
- </td>
964
- </tr>
965
- </table>
966
- </div>
967
-
968
- <div class="method_details ">
969
- <p class="signature " id="parse_reputations-instance_method">
970
-
971
- - (<tt>Object</tt>) <strong>parse_reputations</strong>(result)
972
-
973
-
974
-
975
- </p><table class="source_code">
976
- <tr>
977
- <td>
978
- <pre class="lines">
979
-
980
-
981
- 104
982
- 105
983
- 106</pre>
984
- </td>
985
- <td>
986
- <pre class="code"><span class="info file"># File 'lib/stacked/base.rb', line 104</span>
987
-
988
- <span class='def def kw'>def</span> <span class='parse_reputations identifier id'>parse_reputations</span><span class='lparen token'>(</span><span class='result identifier id'>result</span><span class='rparen token'>)</span>
989
- <span class='parse_type identifier id'>parse_type</span><span class='lparen token'>(</span><span class='result identifier id'>result</span><span class='comma token'>,</span> <span class='string val'>&quot;reputation&quot;</span><span class='rparen token'>)</span>
990
- <span class='end end kw'>end</span>
991
- </pre>
992
- </td>
993
- </tr>
994
- </table>
995
- </div>
996
-
997
- <div class="method_details ">
998
- <p class="signature " id="parse_tags-instance_method">
999
-
1000
- - (<tt>Object</tt>) <strong>parse_tags</strong>(result)
1001
-
1002
-
1003
-
1004
- </p><table class="source_code">
1005
- <tr>
1006
- <td>
1007
- <pre class="lines">
1008
-
1009
-
1010
- 108
1011
- 109
1012
- 110</pre>
1013
- </td>
1014
- <td>
1015
- <pre class="code"><span class="info file"># File 'lib/stacked/base.rb', line 108</span>
1016
-
1017
- <span class='def def kw'>def</span> <span class='parse_tags identifier id'>parse_tags</span><span class='lparen token'>(</span><span class='result identifier id'>result</span><span class='rparen token'>)</span>
1018
- <span class='parse_type identifier id'>parse_type</span><span class='lparen token'>(</span><span class='result identifier id'>result</span><span class='comma token'>,</span> <span class='string val'>&quot;tag&quot;</span><span class='rparen token'>)</span>
1019
- <span class='end end kw'>end</span>
1020
- </pre>
1021
- </td>
1022
- </tr>
1023
- </table>
1024
- </div>
1025
-
1026
- <div class="method_details ">
1027
- <p class="signature " id="parse_type-instance_method">
1028
-
1029
- - (<tt>Object</tt>) <strong>parse_type</strong>(result, type)
1030
-
1031
-
1032
-
1033
- </p><table class="source_code">
1034
- <tr>
1035
- <td>
1036
- <pre class="lines">
1037
-
1038
-
1039
- 116
1040
- 117
1041
- 118</pre>
1042
- </td>
1043
- <td>
1044
- <pre class="code"><span class="info file"># File 'lib/stacked/base.rb', line 116</span>
1045
-
1046
- <span class='def def kw'>def</span> <span class='parse_type identifier id'>parse_type</span><span class='lparen token'>(</span><span class='result identifier id'>result</span><span class='comma token'>,</span> <span class='type identifier id'>type</span><span class='rparen token'>)</span>
1047
- <span class='parse identifier id'>parse</span><span class='lparen token'>(</span><span class='result identifier id'>result</span><span class='lbrack token'>[</span><span class='type identifier id'>type</span><span class='dot token'>.</span><span class='pluralize identifier id'>pluralize</span><span class='rbrack token'>]</span><span class='comma token'>,</span> <span class='dstring node'>&quot;Stacked::#{type.classify}&quot;</span><span class='dot token'>.</span><span class='constantize identifier id'>constantize</span><span class='rparen token'>)</span>
1048
- <span class='end end kw'>end</span>
1049
- </pre>
1050
- </td>
1051
- </tr>
1052
- </table>
1053
- </div>
1054
-
1055
- <div class="method_details ">
1056
- <p class="signature " id="parse_user_timeline-instance_method">
1057
-
1058
- - (<tt>Object</tt>) <strong>parse_user_timeline</strong>(result)
1059
-
1060
-
1061
-
1062
- </p><table class="source_code">
1063
- <tr>
1064
- <td>
1065
- <pre class="lines">
1066
-
1067
-
1068
- 112
1069
- 113
1070
- 114</pre>
1071
- </td>
1072
- <td>
1073
- <pre class="code"><span class="info file"># File 'lib/stacked/base.rb', line 112</span>
1074
-
1075
- <span class='def def kw'>def</span> <span class='parse_user_timeline identifier id'>parse_user_timeline</span><span class='lparen token'>(</span><span class='result identifier id'>result</span><span class='rparen token'>)</span>
1076
- <span class='parse_type identifier id'>parse_type</span><span class='lparen token'>(</span><span class='result identifier id'>result</span><span class='comma token'>,</span> <span class='string val'>&quot;usertimeline&quot;</span><span class='rparen token'>)</span>
1077
- <span class='end end kw'>end</span>
1078
- </pre>
1079
- </td>
1080
- </tr>
1081
- </table>
1082
- </div>
1083
-
1084
- <div class="method_details ">
1085
- <p class="signature " id="post-instance_method">
1086
-
1087
- - (<tt>Object</tt>) <strong>post</strong>
1088
-
1089
-
1090
-
1091
- </p><table class="source_code">
1092
- <tr>
1093
- <td>
1094
- <pre class="lines">
1095
-
1096
-
1097
- 122
1098
- 123
1099
- 124</pre>
1100
- </td>
1101
- <td>
1102
- <pre class="code"><span class="info file"># File 'lib/stacked/base.rb', line 122</span>
1103
-
1104
- <span class='def def kw'>def</span> <span class='post identifier id'>post</span>
1105
- <span class='dstring node'>&quot;Stacked::#{post_type.classify}&quot;</span><span class='dot token'>.</span><span class='constantize identifier id'>constantize</span><span class='dot token'>.</span><span class='find identifier id'>find</span><span class='lparen token'>(</span><span class='post_id identifier id'>post_id</span><span class='rparen token'>)</span>
1106
- <span class='end end kw'>end</span>
1107
- </pre>
1108
- </td>
1109
- </tr>
1110
- </table>
1111
- </div>
1112
-
1113
- </div>
1114
-
1115
- </div>
1116
-
1117
- <div id="footer">
1118
- Generated on Sun Apr 4 18:16:35 2010 by
1119
- <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool">yard</a>
1120
- 0.5.4 (ruby-1.8.7).
1121
- </div>
1122
-
1123
- </body>
1124
- </html>