box-api 0.1.9 → 0.2.0

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.
Files changed (51) hide show
  1. data/Gemfile.lock +1 -1
  2. data/box-api.gemspec +1 -1
  3. data/doc/Box.html +5 -5
  4. data/doc/Box/Account.html +430 -188
  5. data/doc/Box/Api.html +731 -428
  6. data/doc/Box/Api/AccountExceeded.html +3 -3
  7. data/doc/Box/Api/EmailInvalid.html +6 -6
  8. data/doc/Box/Api/EmailTaken.html +3 -3
  9. data/doc/Box/Api/ErrorStatus.html +3 -3
  10. data/doc/Box/Api/Exception.html +3 -3
  11. data/doc/Box/Api/Generic.html +3 -3
  12. data/doc/Box/Api/InvalidFolder.html +6 -6
  13. data/doc/Box/Api/InvalidInput.html +3 -3
  14. data/doc/Box/Api/InvalidName.html +3 -3
  15. data/doc/Box/Api/NameTaken.html +3 -3
  16. data/doc/Box/Api/NoAccess.html +3 -3
  17. data/doc/Box/Api/NoParent.html +3 -3
  18. data/doc/Box/Api/NotAuthorized.html +3 -3
  19. data/doc/Box/Api/Restricted.html +6 -6
  20. data/doc/Box/Api/SizeExceeded.html +3 -3
  21. data/doc/Box/Api/Unknown.html +3 -3
  22. data/doc/Box/Api/UnknownResponse.html +6 -6
  23. data/doc/Box/Api/UploadFailed.html +6 -6
  24. data/doc/Box/Comment.html +560 -0
  25. data/doc/Box/File.html +318 -53
  26. data/doc/Box/Folder.html +298 -136
  27. data/doc/Box/Item.html +398 -348
  28. data/doc/_index.html +22 -7
  29. data/doc/class_list.html +1 -1
  30. data/doc/css/full_list.css +2 -0
  31. data/doc/css/style.css +2 -0
  32. data/doc/file.README.html +3 -3
  33. data/doc/frames.html +1 -1
  34. data/doc/index.html +3 -3
  35. data/doc/js/full_list.js +23 -6
  36. data/doc/method_list.html +233 -89
  37. data/doc/top-level-namespace.html +3 -3
  38. data/examples/files.rb +3 -5
  39. data/examples/login.rb +14 -18
  40. data/lib/box/account.rb +57 -16
  41. data/lib/box/api.rb +34 -1
  42. data/lib/box/api/exceptions.rb +3 -0
  43. data/lib/box/comment.rb +50 -0
  44. data/lib/box/file.rb +31 -0
  45. data/lib/box/folder.rb +57 -1
  46. data/lib/box/item.rb +20 -4
  47. data/spec/account_spec.rb +4 -0
  48. data/spec/file_spec.rb +37 -0
  49. data/spec/folder_spec.rb +78 -0
  50. data/spec/helper/account.rb +1 -1
  51. metadata +55 -61
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  Class: Box::File
8
8
 
9
- &mdash; Documentation by YARD 0.7.2
9
+ &mdash; Documentation by YARD 0.7.3
10
10
 
11
11
  </title>
12
12
 
@@ -96,16 +96,16 @@
96
96
 
97
97
  <h2>Overview</h2><div class="docstring">
98
98
  <div class="discussion">
99
- <p>
100
- Represents a file stored on Box. Any attributes or actions typical to a Box
101
- file can be accessed through this class.
102
- </p>
99
+
100
+ <p>Represents a file stored on Box. Any attributes or actions typical to a Box
101
+ file can be accessed through this class.</p>
103
102
 
104
103
 
105
104
  </div>
106
105
  </div>
107
106
  <div class="tags">
108
107
 
108
+
109
109
  </div>
110
110
 
111
111
 
@@ -147,9 +147,8 @@ file can be accessed through this class.
147
147
 
148
148
 
149
149
 
150
- <span class="summary_desc"><div class='inline'><p>
151
- The string representation of this item.
152
- </p>
150
+ <span class="summary_desc"><div class='inline'>
151
+ <p>The string representation of this item.</p>
153
152
  </div></span>
154
153
 
155
154
  </li>
@@ -167,6 +166,29 @@ The string representation of this item.
167
166
  <li class="public ">
168
167
  <span class="summary_signature">
169
168
 
169
+ <a href="#add_comment-instance_method" title="#add_comment (instance method)">- (Comment) <strong>add_comment</strong>(message) </a>
170
+
171
+
172
+
173
+ </span>
174
+
175
+
176
+
177
+
178
+
179
+
180
+
181
+
182
+ <span class="summary_desc"><div class='inline'>
183
+ <p>Add a comment to the file.</p>
184
+ </div></span>
185
+
186
+ </li>
187
+
188
+
189
+ <li class="public ">
190
+ <span class="summary_signature">
191
+
170
192
  <a href="#download-instance_method" title="#download (instance method)">- (Object) <strong>download</strong>(path) </a>
171
193
 
172
194
 
@@ -180,9 +202,54 @@ The string representation of this item.
180
202
 
181
203
 
182
204
 
183
- <span class="summary_desc"><div class='inline'><p>
184
- Download this file to the specified path.
185
- </p>
205
+ <span class="summary_desc"><div class='inline'>
206
+ <p>Download this file to the specified path.</p>
207
+ </div></span>
208
+
209
+ </li>
210
+
211
+
212
+ <li class="public ">
213
+ <span class="summary_signature">
214
+
215
+ <a href="#embed_code-instance_method" title="#embed_code (instance method)">- (String) <strong>embed_code</strong>(options = Hash.new) </a>
216
+
217
+
218
+
219
+ </span>
220
+
221
+
222
+
223
+
224
+
225
+
226
+
227
+
228
+ <span class="summary_desc"><div class='inline'>
229
+ <p>Request the HTML embed code for this file.</p>
230
+ </div></span>
231
+
232
+ </li>
233
+
234
+
235
+ <li class="public ">
236
+ <span class="summary_signature">
237
+
238
+ <a href="#get_comments-instance_method" title="#get_comments (instance method)">- (Array) <strong>get_comments</strong> </a>
239
+
240
+
241
+
242
+ </span>
243
+
244
+
245
+
246
+
247
+
248
+
249
+
250
+
251
+ <span class="summary_desc"><div class='inline'>
252
+ <p>Get the comments left on this file.</p>
186
253
  </div></span>
187
254
 
188
255
  </li>
@@ -204,9 +271,8 @@ Download this file to the specified path.
204
271
 
205
272
 
206
273
 
207
- <span class="summary_desc"><div class='inline'><p>
208
- Upload a new copy of this file.
209
- </p>
274
+ <span class="summary_desc"><div class='inline'>
275
+ <p>Upload a new copy of this file.</p>
210
276
  </div></span>
211
277
 
212
278
  </li>
@@ -228,9 +294,8 @@ Upload a new copy of this file.
228
294
 
229
295
 
230
296
 
231
- <span class="summary_desc"><div class='inline'><p>
232
- Overwrite this file, using the file at the specified path.
233
- </p>
297
+ <span class="summary_desc"><div class='inline'>
298
+ <p>Overwrite this file, using the file at the specified path.</p>
234
299
  </div></span>
235
300
 
236
301
  </li>
@@ -248,7 +313,7 @@ Overwrite this file, using the file at the specified path.
248
313
 
249
314
 
250
315
  <h3 class="inherited">Methods inherited from <span class='object_link'><a href="Item.html" title="Box::Item (class)">Item</a></span></h3>
251
- <p class="inherited"><span class='object_link'><a href="Item.html#copy-instance_method" title="Box::Item#copy (method)">#copy</a></span>, <span class='object_link'><a href="Item.html#delete-instance_method" title="Box::Item#delete (method)">#delete</a></span>, <span class='object_link'><a href="Item.html#description-instance_method" title="Box::Item#description (method)">#description</a></span>, <span class='object_link'><a href="Item.html#force_cached_info-instance_method" title="Box::Item#force_cached_info (method)">#force_cached_info</a></span>, <span class='object_link'><a href="Item.html#id-instance_method" title="Box::Item#id (method)">#id</a></span>, <span class='object_link'><a href="Item.html#info-instance_method" title="Box::Item#info (method)">#info</a></span>, <span class='object_link'><a href="Item.html#initialize-instance_method" title="Box::Item#initialize (method)">#initialize</a></span>, <span class='object_link'><a href="Item.html#method_missing-instance_method" title="Box::Item#method_missing (method)">#method_missing</a></span>, <span class='object_link'><a href="Item.html#move-instance_method" title="Box::Item#move (method)">#move</a></span>, <span class='object_link'><a href="Item.html#path-instance_method" title="Box::Item#path (method)">#path</a></span>, <span class='object_link'><a href="Item.html#rename-instance_method" title="Box::Item#rename (method)">#rename</a></span>, <span class='object_link'><a href="Item.html#type-instance_method" title="Box::Item#type (method)">#type</a></span>, <span class='object_link'><a href="Item.html#types-class_method" title="Box::Item.types (method)">types</a></span>, <span class='object_link'><a href="Item.html#types-instance_method" title="Box::Item#types (method)">#types</a></span></p>
316
+ <p class="inherited"><span class='object_link'><a href="Item.html#copy-instance_method" title="Box::Item#copy (method)">#copy</a></span>, <span class='object_link'><a href="Item.html#delete-instance_method" title="Box::Item#delete (method)">#delete</a></span>, <span class='object_link'><a href="Item.html#force_cached_info-instance_method" title="Box::Item#force_cached_info (method)">#force_cached_info</a></span>, <span class='object_link'><a href="Item.html#id-instance_method" title="Box::Item#id (method)">#id</a></span>, <span class='object_link'><a href="Item.html#info-instance_method" title="Box::Item#info (method)">#info</a></span>, <span class='object_link'><a href="Item.html#initialize-instance_method" title="Box::Item#initialize (method)">#initialize</a></span>, <span class='object_link'><a href="Item.html#method_missing-instance_method" title="Box::Item#method_missing (method)">#method_missing</a></span>, <span class='object_link'><a href="Item.html#move-instance_method" title="Box::Item#move (method)">#move</a></span>, <span class='object_link'><a href="Item.html#path-instance_method" title="Box::Item#path (method)">#path</a></span>, <span class='object_link'><a href="Item.html#rename-instance_method" title="Box::Item#rename (method)">#rename</a></span>, <span class='object_link'><a href="Item.html#respond_to%3F-instance_method" title="Box::Item#respond_to? (method)">#respond_to?</a></span>, <span class='object_link'><a href="Item.html#set_description-instance_method" title="Box::Item#set_description (method)">#set_description</a></span>, <span class='object_link'><a href="Item.html#type-instance_method" title="Box::Item#type (method)">#type</a></span>, <span class='object_link'><a href="Item.html#types-class_method" title="Box::Item.types (method)">types</a></span>, <span class='object_link'><a href="Item.html#types-instance_method" title="Box::Item#types (method)">#types</a></span></p>
252
317
  <div id="constructor_details" class="method_details_list">
253
318
  <h2>Constructor Details</h2>
254
319
 
@@ -280,15 +345,15 @@ Overwrite this file, using the file at the specified path.
280
345
 
281
346
  </p><div class="docstring">
282
347
  <div class="discussion">
283
- <p>
284
- The string representation of this item.
285
- </p>
348
+
349
+ <p>The string representation of this item.</p>
286
350
 
287
351
 
288
352
  </div>
289
353
  </div>
290
354
  <div class="tags">
291
- <h3>Returns:</h3>
355
+
356
+ <h3>Returns:</h3>
292
357
  <ul class="return">
293
358
 
294
359
  <li>
@@ -299,9 +364,8 @@ The string representation of this item.
299
364
 
300
365
 
301
366
  &mdash;
302
- <div class='inline'><p>
303
- The string representation of this item.
304
- </p>
367
+ <div class='inline'>
368
+ <p>The string representation of this item.</p>
305
369
  </div>
306
370
 
307
371
  </li>
@@ -332,7 +396,68 @@ The string representation of this item.
332
396
 
333
397
 
334
398
  <div class="method_details first">
335
- <p class="signature first" id="download-instance_method">
399
+ <p class="signature first" id="add_comment-instance_method">
400
+
401
+ - (<tt><span class='object_link'><a href="Comment.html" title="Box::Comment (class)">Comment</a></span></tt>) <strong>add_comment</strong>(message)
402
+
403
+
404
+
405
+ </p><div class="docstring">
406
+ <div class="discussion">
407
+
408
+ <p>Add a comment to the file.</p>
409
+
410
+
411
+ </div>
412
+ </div>
413
+ <div class="tags">
414
+
415
+ <h3>Returns:</h3>
416
+ <ul class="return">
417
+
418
+ <li>
419
+
420
+
421
+ <span class='type'>(<tt><span class='object_link'><a href="Comment.html" title="Box::Comment (class)">Comment</a></span></tt>)</span>
422
+
423
+
424
+
425
+ &mdash;
426
+ <div class='inline'>
427
+ <p>The created comment.</p>
428
+ </div>
429
+
430
+ </li>
431
+
432
+ </ul>
433
+
434
+ </div><table class="source_code">
435
+ <tr>
436
+ <td>
437
+ <pre class="lines">
438
+
439
+
440
+ 57
441
+ 58
442
+ 59
443
+ 60
444
+ 61</pre>
445
+ </td>
446
+ <td>
447
+ <pre class="code"><span class="info file"># File 'lib/box/file.rb', line 57</span>
448
+
449
+ <span class='kw'>def</span> <span class='id add_comment'>add_comment</span><span class='lparen'>(</span><span class='id message'>message</span><span class='rparen'>)</span>
450
+ <span class='id response'>response</span> <span class='op'>=</span> <span class='ivar'>@api</span><span class='period'>.</span><span class='id add_comment'>add_comment</span><span class='lparen'>(</span><span class='id type'>type</span><span class='comma'>,</span> <span class='id id'>id</span><span class='comma'>,</span> <span class='id message'>message</span><span class='rparen'>)</span>
451
+
452
+ <span class='const'>Comment</span><span class='period'>.</span><span class='id create'>create</span><span class='lparen'>(</span><span class='ivar'>@api</span><span class='comma'>,</span> <span class='id response'>response</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>comment</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span><span class='rparen'>)</span><span class='period'>.</span><span class='id first'>first</span>
453
+ <span class='kw'>end</span></pre>
454
+ </td>
455
+ </tr>
456
+ </table>
457
+ </div>
458
+
459
+ <div class="method_details ">
460
+ <p class="signature " id="download-instance_method">
336
461
 
337
462
  - (<tt>Object</tt>) <strong>download</strong>(path)
338
463
 
@@ -340,9 +465,8 @@ The string representation of this item.
340
465
 
341
466
  </p><div class="docstring">
342
467
  <div class="discussion">
343
- <p>
344
- Download this file to the specified path.
345
- </p>
468
+
469
+ <p>Download this file to the specified path.</p>
346
470
 
347
471
 
348
472
  </div>
@@ -361,15 +485,15 @@ Download this file to the specified path.
361
485
 
362
486
 
363
487
  &mdash;
364
- <div class='inline'><p>
365
- The path to write the file.
366
- </p>
488
+ <div class='inline'>
489
+ <p>The path to write the file.</p>
367
490
  </div>
368
491
 
369
492
  </li>
370
493
 
371
494
  </ul>
372
495
 
496
+
373
497
  </div><table class="source_code">
374
498
  <tr>
375
499
  <td>
@@ -389,6 +513,151 @@ The path to write the file.
389
513
  </td>
390
514
  </tr>
391
515
  </table>
516
+ </div>
517
+
518
+ <div class="method_details ">
519
+ <p class="signature " id="embed_code-instance_method">
520
+
521
+ - (<tt>String</tt>) <strong>embed_code</strong>(options = Hash.new)
522
+
523
+
524
+
525
+ </p><div class="docstring">
526
+ <div class="discussion">
527
+
528
+ <p>Request the HTML embed code for this file.</p>
529
+
530
+
531
+ </div>
532
+ </div>
533
+ <div class="tags">
534
+ <h3>Parameters:</h3>
535
+ <ul class="param">
536
+
537
+ <li>
538
+
539
+ <span class='name'>options</span>
540
+
541
+
542
+ <span class='type'>(<tt>Optional</tt>, <tt>Hash{:allow_download,:allow_print,:allow_share,
543
+ :width,:height,:color =&gt; String}</tt>)</span>
544
+
545
+
546
+ <em class="default">(defaults to: <tt>Hash.new</tt>)</em>
547
+
548
+
549
+ &mdash;
550
+ <div class='inline'>
551
+ <p>Options to use when generating the embed code.</p>
552
+ </div>
553
+
554
+ </li>
555
+
556
+ </ul>
557
+
558
+ <h3>Returns:</h3>
559
+ <ul class="return">
560
+
561
+ <li>
562
+
563
+
564
+ <span class='type'>(<tt>String</tt>)</span>
565
+
566
+
567
+
568
+ &mdash;
569
+ <div class='inline'>
570
+ <p>HTML code to use to embed the file.</p>
571
+ </div>
572
+
573
+ </li>
574
+
575
+ </ul>
576
+
577
+ </div><table class="source_code">
578
+ <tr>
579
+ <td>
580
+ <pre class="lines">
581
+
582
+
583
+ 70
584
+ 71
585
+ 72</pre>
586
+ </td>
587
+ <td>
588
+ <pre class="code"><span class="info file"># File 'lib/box/file.rb', line 70</span>
589
+
590
+ <span class='kw'>def</span> <span class='id embed_code'>embed_code</span><span class='lparen'>(</span><span class='id options'>options</span> <span class='op'>=</span> <span class='const'>Hash</span><span class='period'>.</span><span class='id new'>new</span><span class='rparen'>)</span>
591
+ <span class='ivar'>@api</span><span class='period'>.</span><span class='id file_embed'>file_embed</span><span class='lparen'>(</span><span class='id id'>id</span><span class='comma'>,</span> <span class='id options'>options</span><span class='rparen'>)</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>file_embed_html</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span>
592
+ <span class='kw'>end</span></pre>
593
+ </td>
594
+ </tr>
595
+ </table>
596
+ </div>
597
+
598
+ <div class="method_details ">
599
+ <p class="signature " id="get_comments-instance_method">
600
+
601
+ - (<tt>Array</tt>) <strong>get_comments</strong>
602
+
603
+
604
+
605
+ </p><div class="docstring">
606
+ <div class="discussion">
607
+
608
+ <p>Get the comments left on this file.</p>
609
+
610
+
611
+ </div>
612
+ </div>
613
+ <div class="tags">
614
+
615
+ <h3>Returns:</h3>
616
+ <ul class="return">
617
+
618
+ <li>
619
+
620
+
621
+ <span class='type'>(<tt>Array</tt>)</span>
622
+
623
+
624
+
625
+ &mdash;
626
+ <div class='inline'>
627
+ <p>An array of <span class='object_link'><a href="Comment.html" title="Box::Comment (class)">Comment</a></span>s.</p>
628
+ </div>
629
+
630
+ </li>
631
+
632
+ </ul>
633
+
634
+ </div><table class="source_code">
635
+ <tr>
636
+ <td>
637
+ <pre class="lines">
638
+
639
+
640
+ 46
641
+ 47
642
+ 48
643
+ 49
644
+ 50
645
+ 51
646
+ 52</pre>
647
+ </td>
648
+ <td>
649
+ <pre class="code"><span class="info file"># File 'lib/box/file.rb', line 46</span>
650
+
651
+ <span class='kw'>def</span> <span class='id get_comments'>get_comments</span>
652
+ <span class='id comments'>comments</span> <span class='op'>=</span> <span class='ivar'>@api</span><span class='period'>.</span><span class='id get_comments'>get_comments</span><span class='lparen'>(</span><span class='id type'>type</span><span class='comma'>,</span> <span class='id id'>id</span><span class='rparen'>)</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>comments</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span>
653
+
654
+ <span class='id comments'>comments</span> <span class='op'>=</span> <span class='const'>Comment</span><span class='period'>.</span><span class='id create'>create</span><span class='lparen'>(</span><span class='ivar'>@api</span><span class='comma'>,</span> <span class='id comments'>comments</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>comment</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='id comments'>comments</span>
655
+
656
+ <span class='ivar'>@data</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>comments</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id comments'>comments</span> <span class='op'>||</span> <span class='const'>Array</span><span class='period'>.</span><span class='id new'>new</span>
657
+ <span class='kw'>end</span></pre>
658
+ </td>
659
+ </tr>
660
+ </table>
392
661
  </div>
393
662
 
394
663
  <div class="method_details ">
@@ -400,10 +669,9 @@ The path to write the file.
400
669
 
401
670
  </p><div class="docstring">
402
671
  <div class="discussion">
403
- <p>
404
- Upload a new copy of this file. The name will be &#8220;file (#).ext&#8221;
405
- for the each additional copy.
406
- </p>
672
+
673
+ <p>Upload a new copy of this file. The name will be "file (#).ext" for the
674
+ each additional copy.</p>
407
675
 
408
676
 
409
677
  </div>
@@ -422,14 +690,14 @@ for the each additional copy.
422
690
 
423
691
 
424
692
  &mdash;
425
- <div class='inline'><p>
426
- The path to the file to upload.
427
- </p>
693
+ <div class='inline'>
694
+ <p>The path to the file to upload.</p>
428
695
  </div>
429
696
 
430
697
  </li>
431
698
 
432
699
  </ul>
700
+
433
701
  <h3>Returns:</h3>
434
702
  <ul class="return">
435
703
 
@@ -441,9 +709,8 @@ The path to the file to upload.
441
709
 
442
710
 
443
711
  &mdash;
444
- <div class='inline'><p>
445
- The newly created file.
446
- </p>
712
+ <div class='inline'>
713
+ <p>The newly created file.</p>
447
714
  </div>
448
715
 
449
716
  </li>
@@ -486,9 +753,8 @@ The newly created file.
486
753
 
487
754
  </p><div class="docstring">
488
755
  <div class="discussion">
489
- <p>
490
- Overwrite this file, using the file at the specified path
491
- </p>
756
+
757
+ <p>Overwrite this file, using the file at the specified path</p>
492
758
 
493
759
 
494
760
  </div>
@@ -507,14 +773,14 @@ Overwrite this file, using the file at the specified path
507
773
 
508
774
 
509
775
  &mdash;
510
- <div class='inline'><p>
511
- The path to the file to upload.
512
- </p>
776
+ <div class='inline'>
777
+ <p>The path to the file to upload.</p>
513
778
  </div>
514
779
 
515
780
  </li>
516
781
 
517
782
  </ul>
783
+
518
784
  <h3>Returns:</h3>
519
785
  <ul class="return">
520
786
 
@@ -526,9 +792,8 @@ The path to the file to upload.
526
792
 
527
793
 
528
794
  &mdash;
529
- <div class='inline'><p>
530
- self
531
- </p>
795
+ <div class='inline'>
796
+ <p>self</p>
532
797
  </div>
533
798
 
534
799
  </li>
@@ -571,9 +836,9 @@ self
571
836
  </div>
572
837
 
573
838
  <div id="footer">
574
- Generated on Mon Aug 8 13:05:22 2011 by
839
+ Generated on Tue Nov 8 15:32:23 2011 by
575
840
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
576
- 0.7.2 (ruby-1.9.2).
841
+ 0.7.3 (ruby-1.9.3).
577
842
  </div>
578
843
 
579
844
  </body>