groupdocs 1.5.0 → 1.5.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (90) hide show
  1. data/CHANGELOG.md +6 -0
  2. data/examples/api-samples/README.md +1 -1
  3. data/examples/api-samples/public/css/style.css +2 -2
  4. data/examples/api-samples/public/docs/annotation-sample.html +57 -0
  5. data/examples/api-samples/public/docs/envelope-sample.html +32 -32
  6. data/examples/api-samples/public/docs/sample1.html +3 -3
  7. data/examples/api-samples/public/docs/sample10.html +25 -24
  8. data/examples/api-samples/public/docs/sample11.html +17 -17
  9. data/examples/api-samples/public/docs/sample12.html +4 -4
  10. data/examples/api-samples/public/docs/sample13.html +5 -5
  11. data/examples/api-samples/public/docs/sample14.html +5 -5
  12. data/examples/api-samples/public/docs/sample15.html +4 -4
  13. data/examples/api-samples/public/docs/sample16.html +3 -3
  14. data/examples/api-samples/public/docs/sample17.html +3 -3
  15. data/examples/api-samples/public/docs/sample18.html +129 -34
  16. data/examples/api-samples/public/docs/sample19.html +59 -0
  17. data/examples/api-samples/public/docs/sample2.html +5 -5
  18. data/examples/api-samples/public/docs/sample20.html +51 -0
  19. data/examples/api-samples/public/docs/sample21.html +66 -0
  20. data/examples/api-samples/public/docs/sample22.html +53 -0
  21. data/examples/api-samples/public/docs/sample3.html +4 -4
  22. data/examples/api-samples/public/docs/sample4.html +27 -16
  23. data/examples/api-samples/public/docs/sample5.html +29 -22
  24. data/examples/api-samples/public/docs/sample6.html +6 -6
  25. data/examples/api-samples/public/docs/sample7.html +8 -8
  26. data/examples/api-samples/public/docs/sample8.html +31 -23
  27. data/examples/api-samples/public/docs/sample9.html +26 -8
  28. data/examples/api-samples/public/templates/merge_feid_doc.docx +0 -0
  29. data/examples/api-samples/samples/annotation-sample.rb +22 -16
  30. data/examples/api-samples/samples/envelope-sample.rb +26 -25
  31. data/examples/api-samples/samples/sample1.rb +2 -2
  32. data/examples/api-samples/samples/sample10.rb +21 -20
  33. data/examples/api-samples/samples/sample11.rb +18 -18
  34. data/examples/api-samples/samples/sample12.rb +3 -3
  35. data/examples/api-samples/samples/sample13.rb +4 -4
  36. data/examples/api-samples/samples/sample14.rb +4 -4
  37. data/examples/api-samples/samples/sample15.rb +3 -3
  38. data/examples/api-samples/samples/sample16.rb +2 -2
  39. data/examples/api-samples/samples/sample17.rb +2 -2
  40. data/examples/api-samples/samples/sample18.rb +90 -106
  41. data/examples/api-samples/samples/sample19.rb +5 -5
  42. data/examples/api-samples/samples/sample2.rb +4 -4
  43. data/examples/api-samples/samples/sample20.rb +4 -4
  44. data/examples/api-samples/samples/sample21.rb +4 -4
  45. data/examples/api-samples/samples/sample22.rb +2 -2
  46. data/examples/api-samples/samples/sample23.rb +0 -0
  47. data/examples/api-samples/samples/sample24.rb +0 -0
  48. data/examples/api-samples/samples/sample25.rb +96 -0
  49. data/examples/api-samples/samples/sample3.rb +3 -3
  50. data/examples/api-samples/samples/sample4.rb +23 -12
  51. data/examples/api-samples/samples/sample5.rb +23 -16
  52. data/examples/api-samples/samples/sample6.rb +8 -8
  53. data/examples/api-samples/samples/sample7.rb +7 -7
  54. data/examples/api-samples/samples/sample8.rb +29 -21
  55. data/examples/api-samples/samples/sample9.rb +23 -5
  56. data/examples/api-samples/views/_others_samples.haml +57 -0
  57. data/examples/api-samples/views/annotation_sample.haml +30 -30
  58. data/examples/api-samples/views/envelope_sample.haml +31 -31
  59. data/examples/api-samples/views/index.haml +33 -25
  60. data/examples/api-samples/views/sample1.haml +22 -69
  61. data/examples/api-samples/views/sample10.haml +57 -73
  62. data/examples/api-samples/views/sample11.haml +31 -79
  63. data/examples/api-samples/views/sample12.haml +18 -66
  64. data/examples/api-samples/views/sample13.haml +21 -70
  65. data/examples/api-samples/views/sample14.haml +18 -67
  66. data/examples/api-samples/views/sample15.haml +15 -63
  67. data/examples/api-samples/views/sample16.haml +13 -61
  68. data/examples/api-samples/views/sample17.haml +19 -67
  69. data/examples/api-samples/views/sample18.haml +74 -159
  70. data/examples/api-samples/views/sample19.haml +25 -74
  71. data/examples/api-samples/views/sample2.haml +19 -66
  72. data/examples/api-samples/views/sample20.haml +19 -68
  73. data/examples/api-samples/views/sample21.haml +28 -76
  74. data/examples/api-samples/views/sample22.haml +29 -77
  75. data/examples/api-samples/views/sample23.haml +0 -0
  76. data/examples/api-samples/views/sample24.haml +0 -0
  77. data/examples/api-samples/views/sample25.haml +91 -0
  78. data/examples/api-samples/views/sample3.haml +20 -68
  79. data/examples/api-samples/views/sample4.haml +53 -68
  80. data/examples/api-samples/views/sample5.haml +54 -70
  81. data/examples/api-samples/views/sample6.haml +21 -69
  82. data/examples/api-samples/views/sample7.haml +19 -66
  83. data/examples/api-samples/views/sample8.haml +60 -75
  84. data/examples/api-samples/views/sample9.haml +54 -70
  85. data/examples/api-samples/web.rb +20 -0
  86. data/lib/groupdocs/api/request.rb +4 -2
  87. data/lib/groupdocs/version.rb +1 -1
  88. data/spec/groupdocs/api/request_spec.rb +10 -2
  89. metadata +18 -5
  90. data/examples/api-samples/app.rb +0 -15
@@ -1,3 +1,9 @@
1
+ ## v1.5.1
2
+
3
+ **New**
4
+
5
+ * Added `:sign` flag `Api::Request.options` allowing request not to be signed
6
+
1
7
  ## v1.5.0
2
8
 
3
9
  **New**
@@ -13,7 +13,7 @@
13
13
  bundle install
14
14
 
15
15
  ####Run the web app:
16
- bundle exec ruby app.rb
16
+ bundle exec ruby web.rb
17
17
 
18
18
  ####Now open `http://localhost:4567` and try it!
19
19
 
@@ -211,12 +211,12 @@ div.footer h5 {
211
211
 
212
212
  .description {
213
213
  font-style: italic;
214
- background: url(/images/info.png) no-repeat left;
214
+ background: url(../images/info.png) no-repeat left;
215
215
  padding-left: 25px;
216
216
  }
217
217
 
218
218
  .documentation {
219
219
  float: right;
220
- background: url(/images/help.png) no-repeat left;
220
+ background: url(../images/help.png) no-repeat left;
221
221
  padding-left: 20px;
222
222
  }
@@ -0,0 +1,57 @@
1
+ <!DOCTYPE html> <html> <head> <title>annotation-sample.rb</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <link rel="stylesheet" media="all" href="docco.css" /> </head> <body> <div id="container"> <div id="background"></div> <div id="jump_to"> Jump To &hellip; <div id="jump_wrapper"> <div id="jump_page"> <a class="source" href="annotation-sample.html"> annotation-sample.rb </a> <a class="source" href="envelope-sample.html"> envelope-sample.rb </a> <a class="source" href="sample1.html"> sample1.rb </a> <a class="source" href="sample10.html"> sample10.rb </a> <a class="source" href="sample11.html"> sample11.rb </a> <a class="source" href="sample12.html"> sample12.rb </a> <a class="source" href="sample13.html"> sample13.rb </a> <a class="source" href="sample14.html"> sample14.rb </a> <a class="source" href="sample15.html"> sample15.rb </a> <a class="source" href="sample16.html"> sample16.rb </a> <a class="source" href="sample17.html"> sample17.rb </a> <a class="source" href="sample18.html"> sample18.rb </a> <a class="source" href="sample19.html"> sample19.rb </a> <a class="source" href="sample2.html"> sample2.rb </a> <a class="source" href="sample20.html"> sample20.rb </a> <a class="source" href="sample21.html"> sample21.rb </a> <a class="source" href="sample22.html"> sample22.rb </a> <a class="source" href="sample3.html"> sample3.rb </a> <a class="source" href="sample4.html"> sample4.rb </a> <a class="source" href="sample5.html"> sample5.rb </a> <a class="source" href="sample6.html"> sample6.rb </a> <a class="source" href="sample7.html"> sample7.rb </a> <a class="source" href="sample8.html"> sample8.rb </a> <a class="source" href="sample9.html"> sample9.rb </a> </div> </div> </div> <table cellpadding="0" cellspacing="0"> <thead> <tr> <th class="docs"> <h1> annotation-sample.rb </h1> </th> <th class="code"> </th> </tr> </thead> <tbody> <tr id="section-1"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-1">&#182;</a> </div> <p>GET request</p> </td> <td class="code"> <div class="highlight"><pre><span class="n">get</span> <span class="s1">&#39;/annotation-sample&#39;</span> <span class="k">do</span>
2
+ <span class="n">haml</span> <span class="ss">:annotation_sample</span>
3
+ <span class="k">end</span>
4
+
5
+
6
+ <span class="n">post</span> <span class="s1">&#39;/annotation-sample&#39;</span> <span class="k">do</span>
7
+ <span class="n">set</span> <span class="ss">:client_id</span><span class="p">,</span> <span class="n">params</span><span class="o">[</span><span class="ss">:client_id</span><span class="o">]</span>
8
+ <span class="n">set</span> <span class="ss">:private_key</span><span class="p">,</span> <span class="n">params</span><span class="o">[</span><span class="ss">:private_key</span><span class="o">]</span>
9
+
10
+ <span class="n">set</span> <span class="ss">:email</span><span class="p">,</span> <span class="n">params</span><span class="o">[</span><span class="ss">:email</span><span class="o">]</span>
11
+ <span class="n">set</span> <span class="ss">:first_name</span><span class="p">,</span> <span class="n">params</span><span class="o">[</span><span class="ss">:first_name</span><span class="o">]</span>
12
+ <span class="n">set</span> <span class="ss">:last_name</span><span class="p">,</span> <span class="n">params</span><span class="o">[</span><span class="ss">:last_name</span><span class="o">]</span>
13
+ <span class="n">set</span> <span class="ss">:file_name</span><span class="p">,</span> <span class="n">params</span><span class="o">[</span><span class="ss">:file_name</span><span class="o">]</span>
14
+
15
+ <span class="k">begin</span>
16
+ <span class="k">raise</span> <span class="s1">&#39;Please enter all required parameters&#39;</span> <span class="k">if</span> <span class="n">settings</span><span class="o">.</span><span class="n">client_id</span><span class="o">.</span><span class="n">empty?</span> <span class="ow">or</span> <span class="n">settings</span><span class="o">.</span><span class="n">private_key</span><span class="o">.</span><span class="n">empty?</span> <span class="ow">or</span> <span class="n">settings</span><span class="o">.</span><span class="n">file_name</span><span class="o">.</span><span class="n">empty?</span>
17
+
18
+ <span class="no">GroupDocs</span><span class="o">.</span><span class="n">configure</span> <span class="k">do</span> <span class="o">|</span><span class="n">groupdocs</span><span class="o">|</span>
19
+ <span class="n">groupdocs</span><span class="o">.</span><span class="n">client_id</span> <span class="o">=</span> <span class="n">params</span><span class="o">[</span><span class="ss">:client_id</span><span class="o">]</span>
20
+ <span class="n">groupdocs</span><span class="o">.</span><span class="n">private_key</span> <span class="o">=</span> <span class="n">params</span><span class="o">[</span><span class="ss">:private_key</span><span class="o">]</span>
21
+ <span class="n">groupdocs</span><span class="o">.</span><span class="n">api_server</span> <span class="o">=</span> <span class="s1">&#39;https://api.groupdocs.com&#39;</span>
22
+ <span class="k">end</span>
23
+
24
+ <span class="n">metadata</span> <span class="o">=</span> <span class="ss">GroupDocs</span><span class="p">:</span><span class="ss">:Document</span><span class="o">.</span><span class="n">metadata!</span><span class="p">(</span><span class="n">settings</span><span class="o">.</span><span class="n">file_name</span><span class="p">)</span>
25
+ <span class="n">document</span> <span class="o">=</span> <span class="ss">GroupDocs</span><span class="p">:</span><span class="ss">:Storage</span><span class="o">::</span><span class="no">File</span><span class="o">.</span><span class="n">new</span><span class="p">(</span><span class="nb">id</span><span class="p">:</span> <span class="n">metadata</span><span class="o">.</span><span class="n">id</span><span class="p">,</span> <span class="ss">guid</span><span class="p">:</span> <span class="n">metadata</span><span class="o">.</span><span class="n">guid</span><span class="p">)</span><span class="o">.</span><span class="n">to_document</span>
26
+
27
+
28
+ <span class="n">user</span> <span class="o">=</span> <span class="ss">GroupDocs</span><span class="p">:</span><span class="ss">:User</span><span class="o">.</span><span class="n">new</span>
29
+ <span class="n">user</span><span class="o">.</span><span class="n">nickname</span> <span class="o">=</span> <span class="n">settings</span><span class="o">.</span><span class="n">email</span>
30
+ <span class="n">user</span><span class="o">.</span><span class="n">primary_email</span> <span class="o">=</span> <span class="n">settings</span><span class="o">.</span><span class="n">email</span>
31
+ <span class="n">user</span><span class="o">.</span><span class="n">first_name</span> <span class="o">=</span> <span class="n">settings</span><span class="o">.</span><span class="n">first_name</span>
32
+ <span class="n">user</span><span class="o">.</span><span class="n">last_name</span> <span class="o">=</span> <span class="n">settings</span><span class="o">.</span><span class="n">last_name</span>
33
+ <span class="n">user</span> <span class="o">=</span> <span class="ss">GroupDocs</span><span class="p">:</span><span class="ss">:User</span><span class="o">.</span><span class="n">update_account!</span><span class="p">(</span><span class="n">user</span><span class="p">)</span>
34
+
35
+
36
+ <span class="n">document</span><span class="o">.</span><span class="n">add_collaborator!</span> <span class="n">user</span> <span class="k">unless</span> <span class="n">document</span><span class="o">.</span><span class="n">collaborators!</span><span class="o">.</span><span class="n">any?</span> <span class="p">{</span> <span class="o">|</span><span class="n">c</span><span class="o">|</span> <span class="n">c</span><span class="o">.</span><span class="n">guid</span> <span class="o">==</span> <span class="n">user</span><span class="o">.</span><span class="n">guid</span> <span class="p">}</span>
37
+
38
+
39
+ <span class="n">annotation</span> <span class="o">=</span> <span class="kp">true</span> <span class="c1"># looks like &quot;IsAnnotation&quot; is some helper method so I stub it here</span>
40
+ <span class="n">url</span> <span class="o">=</span> <span class="k">if</span> <span class="n">annotation</span>
41
+ <span class="s2">&quot;/document-annotation2/embed?quality=50&amp;guid=</span><span class="si">#{</span><span class="n">document</span><span class="o">.</span><span class="n">file</span><span class="o">.</span><span class="n">guid</span><span class="si">}</span><span class="s2">&amp;uid=</span><span class="si">#{</span><span class="n">user</span><span class="o">.</span><span class="n">guid</span><span class="si">}</span><span class="s2">&amp;download=True&quot;</span>
42
+ <span class="k">else</span>
43
+ <span class="s2">&quot;/document-viewer/embed?quality=50&amp;guid=</span><span class="si">#{</span><span class="n">document</span><span class="o">.</span><span class="n">file</span><span class="o">.</span><span class="n">guid</span><span class="si">}</span><span class="s2">&amp;uid=</span><span class="si">#{</span><span class="n">user</span><span class="o">.</span><span class="n">guid</span><span class="si">}</span><span class="s2">&amp;download=True&quot;</span>
44
+ <span class="k">end</span>
45
+
46
+
47
+ url = GroupDocs::Api::Request.new(path: url).prepare<em>and</em>sign_url</p> </td> <td class="code"> <div class="highlight"><pre>
48
+
49
+ <span class="n">iframe</span> <span class="o">=</span> <span class="s2">&quot;&lt;iframe src=&#39;https://apps.groupdocs.com</span><span class="si">#{</span><span class="n">url</span><span class="si">}</span><span class="s2">&#39; frameborder=&#39;0&#39; width=&#39;720&#39; height=&#39;600&#39;&gt;&lt;/iframe&gt;&quot;</span>
50
+ <span class="k">rescue</span> <span class="no">Exception</span> <span class="o">=&gt;</span> <span class="n">e</span>
51
+ <span class="n">err</span> <span class="o">=</span> <span class="n">e</span><span class="o">.</span><span class="n">message</span>
52
+ <span class="k">end</span>
53
+
54
+ <span class="n">haml</span> <span class="ss">:annotation_sample</span><span class="p">,</span> <span class="ss">:locals</span> <span class="o">=&gt;</span> <span class="p">{</span><span class="ss">:client_id</span> <span class="o">=&gt;</span> <span class="n">settings</span><span class="o">.</span><span class="n">client_id</span><span class="p">,</span> <span class="ss">:private_key</span> <span class="o">=&gt;</span> <span class="n">settings</span><span class="o">.</span><span class="n">private_key</span><span class="p">,</span> <span class="ss">:err</span> <span class="o">=&gt;</span> <span class="n">err</span><span class="p">,</span> <span class="ss">:file_name</span> <span class="o">=&gt;</span> <span class="n">settings</span><span class="o">.</span><span class="n">file_name</span><span class="p">,</span> <span class="ss">:email</span> <span class="o">=&gt;</span> <span class="n">settings</span><span class="o">.</span><span class="n">email</span><span class="p">,</span> <span class="ss">:first_name</span> <span class="o">=&gt;</span> <span class="n">settings</span><span class="o">.</span><span class="n">first_name</span><span class="p">,</span> <span class="ss">:last_name</span> <span class="o">=&gt;</span> <span class="n">settings</span><span class="o">.</span><span class="n">last_name</span><span class="p">,</span> <span class="ss">:iframe</span> <span class="o">=&gt;</span> <span class="n">iframe</span><span class="p">}</span>
55
+ <span class="k">end</span>
56
+
57
+ </pre></div> </td> </tr> </tbody> </table> </div> </body> </html>
@@ -1,4 +1,4 @@
1
- <!DOCTYPE html> <html> <head> <title>envelope-sample.rb</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <link rel="stylesheet" media="all" href="docco.css" /> </head> <body> <div id="container"> <div id="background"></div> <div id="jump_to"> Jump To &hellip; <div id="jump_wrapper"> <div id="jump_page"> <a class="source" href="envelope-sample.html"> envelope-sample.rb </a> <a class="source" href="sample1.html"> sample1.rb </a> <a class="source" href="sample10.html"> sample10.rb </a> <a class="source" href="sample11.html"> sample11.rb </a> <a class="source" href="sample12.html"> sample12.rb </a> <a class="source" href="sample13.html"> sample13.rb </a> <a class="source" href="sample14.html"> sample14.rb </a> <a class="source" href="sample15.html"> sample15.rb </a> <a class="source" href="sample16.html"> sample16.rb </a> <a class="source" href="sample17.html"> sample17.rb </a> <a class="source" href="sample18.html"> sample18.rb </a> <a class="source" href="sample2.html"> sample2.rb </a> <a class="source" href="sample3.html"> sample3.rb </a> <a class="source" href="sample4.html"> sample4.rb </a> <a class="source" href="sample5.html"> sample5.rb </a> <a class="source" href="sample6.html"> sample6.rb </a> <a class="source" href="sample7.html"> sample7.rb </a> <a class="source" href="sample8.html"> sample8.rb </a> <a class="source" href="sample9.html"> sample9.rb </a> </div> </div> </div> <table cellpadding="0" cellspacing="0"> <thead> <tr> <th class="docs"> <h1> envelope-sample.rb </h1> </th> <th class="code"> </th> </tr> </thead> <tbody> <tr id="section-1"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-1">&#182;</a> </div> <p>GET request</p> </td> <td class="code"> <div class="highlight"><pre><span class="n">get</span> <span class="s1">&#39;/envelope-sample&#39;</span> <span class="k">do</span>
1
+ <!DOCTYPE html> <html> <head> <title>envelope-sample.rb</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <link rel="stylesheet" media="all" href="docco.css" /> </head> <body> <div id="container"> <div id="background"></div> <div id="jump_to"> Jump To &hellip; <div id="jump_wrapper"> <div id="jump_page"> <a class="source" href="annotation-sample.html"> annotation-sample.rb </a> <a class="source" href="envelope-sample.html"> envelope-sample.rb </a> <a class="source" href="sample1.html"> sample1.rb </a> <a class="source" href="sample10.html"> sample10.rb </a> <a class="source" href="sample11.html"> sample11.rb </a> <a class="source" href="sample12.html"> sample12.rb </a> <a class="source" href="sample13.html"> sample13.rb </a> <a class="source" href="sample14.html"> sample14.rb </a> <a class="source" href="sample15.html"> sample15.rb </a> <a class="source" href="sample16.html"> sample16.rb </a> <a class="source" href="sample17.html"> sample17.rb </a> <a class="source" href="sample18.html"> sample18.rb </a> <a class="source" href="sample19.html"> sample19.rb </a> <a class="source" href="sample2.html"> sample2.rb </a> <a class="source" href="sample20.html"> sample20.rb </a> <a class="source" href="sample21.html"> sample21.rb </a> <a class="source" href="sample22.html"> sample22.rb </a> <a class="source" href="sample3.html"> sample3.rb </a> <a class="source" href="sample4.html"> sample4.rb </a> <a class="source" href="sample5.html"> sample5.rb </a> <a class="source" href="sample6.html"> sample6.rb </a> <a class="source" href="sample7.html"> sample7.rb </a> <a class="source" href="sample8.html"> sample8.rb </a> <a class="source" href="sample9.html"> sample9.rb </a> </div> </div> </div> <table cellpadding="0" cellspacing="0"> <thead> <tr> <th class="docs"> <h1> envelope-sample.rb </h1> </th> <th class="code"> </th> </tr> </thead> <tbody> <tr id="section-1"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-1">&#182;</a> </div> <p>GET request</p> </td> <td class="code"> <div class="highlight"><pre><span class="n">get</span> <span class="s1">&#39;/envelope-sample&#39;</span> <span class="k">do</span>
2
2
  <span class="n">haml</span> <span class="ss">:envelope_sample</span>
3
3
  <span class="k">end</span>
4
4
 
@@ -7,14 +7,13 @@
7
7
 
8
8
  <span class="n">data</span> <span class="o">=</span> <span class="no">JSON</span><span class="o">.</span><span class="n">parse</span><span class="p">(</span><span class="n">request</span><span class="o">.</span><span class="n">body</span><span class="o">.</span><span class="n">read</span><span class="p">)</span>
9
9
  <span class="k">begin</span>
10
- <span class="k">raise</span> <span class="s2">&quot;Empty params!&quot;</span> <span class="k">if</span> <span class="n">data</span><span class="o">.</span><span class="n">empty?</span>
11
-
10
+ <span class="k">raise</span> <span class="s1">&#39;Empty params!&#39;</span> <span class="k">if</span> <span class="n">data</span><span class="o">.</span><span class="n">empty?</span>
12
11
 
13
- <span class="n">outFile</span> <span class="o">=</span> <span class="no">File</span><span class="o">.</span><span class="n">new</span><span class="p">(</span><span class="s2">&quot;signed&quot;</span><span class="p">,</span> <span class="s2">&quot;w&quot;</span><span class="p">)</span>
14
- <span class="n">data</span><span class="o">.</span><span class="n">each</span> <span class="k">do</span> <span class="o">|</span><span class="n">key</span><span class="p">,</span> <span class="n">value</span><span class="o">|</span>
15
- <span class="n">outFile</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="s2">&quot;</span><span class="si">#{</span><span class="n">key</span><span class="si">}</span><span class="s2">: </span><span class="si">#{</span><span class="n">value</span><span class="si">}</span><span class="s2"> </span><span class="se">\n</span><span class="s2">&quot;</span><span class="p">)</span>
16
- <span class="k">end</span>
17
- <span class="n">outFile</span><span class="o">.</span><span class="n">close</span>
12
+ <span class="n">out_file</span> <span class="o">=</span> <span class="no">File</span><span class="o">.</span><span class="n">new</span><span class="p">(</span><span class="s1">&#39;signed&#39;</span><span class="p">,</span> <span class="s1">&#39;w&#39;</span><span class="p">)</span>
13
+ <span class="n">data</span><span class="o">.</span><span class="n">each</span> <span class="k">do</span> <span class="o">|</span><span class="n">key</span><span class="p">,</span> <span class="n">value</span><span class="o">|</span>
14
+ <span class="n">out_file</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="s2">&quot;</span><span class="si">#{</span><span class="n">key</span><span class="si">}</span><span class="s2">: </span><span class="si">#{</span><span class="n">value</span><span class="si">}</span><span class="s2"> </span><span class="se">\n</span><span class="s2">&quot;</span><span class="p">)</span>
15
+ <span class="k">end</span>
16
+ <span class="n">out_file</span><span class="o">.</span><span class="n">close</span>
18
17
  <span class="k">rescue</span> <span class="no">Exception</span> <span class="o">=&gt;</span> <span class="n">e</span>
19
18
  <span class="n">err</span> <span class="o">=</span> <span class="n">e</span><span class="o">.</span><span class="n">message</span>
20
19
  <span class="k">end</span>
@@ -24,18 +23,18 @@
24
23
 
25
24
  <span class="n">post</span> <span class="s1">&#39;/envelope-sample/sign-and-download&#39;</span> <span class="k">do</span>
26
25
  <span class="n">data</span> <span class="o">=</span> <span class="no">JSON</span><span class="o">.</span><span class="n">parse</span><span class="p">(</span><span class="n">request</span><span class="o">.</span><span class="n">body</span><span class="o">.</span><span class="n">read</span><span class="p">)</span>
27
- <span class="k">begin</span>
28
- <span class="k">raise</span> <span class="s2">&quot;Empty params!&quot;</span> <span class="k">if</span> <span class="n">data</span><span class="o">.</span><span class="n">empty?</span>
26
+ <span class="k">begin</span>
27
+ <span class="k">raise</span> <span class="s1">&#39;Empty params!&#39;</span> <span class="k">if</span> <span class="n">data</span><span class="o">.</span><span class="n">empty?</span>
29
28
  <span class="no">GroupDocs</span><span class="o">.</span><span class="n">configure</span> <span class="k">do</span> <span class="o">|</span><span class="n">groupdocs</span><span class="o">|</span>
30
- <span class="n">groupdocs</span><span class="o">.</span><span class="n">client_id</span> <span class="o">=</span> <span class="s1">&#39;&#39;</span> <span class="c1"># Your client Client ID here</span>
31
- <span class="n">groupdocs</span><span class="o">.</span><span class="n">private_key</span> <span class="o">=</span> <span class="s1">&#39;&#39;</span> <span class="c1"># Your API Key here</span>
32
- <span class="n">groupdocs</span><span class="o">.</span><span class="n">api_server</span> <span class="o">=</span> <span class="s1">&#39;https://api.groupdocs.com&#39;</span>
29
+ <span class="n">groupdocs</span><span class="o">.</span><span class="n">client_id</span> <span class="o">=</span> <span class="s1">&#39;&#39;</span> <span class="c1"># Your client Client ID here</span>
30
+ <span class="n">groupdocs</span><span class="o">.</span><span class="n">private_key</span> <span class="o">=</span> <span class="s1">&#39;&#39;</span> <span class="c1"># Your API Key here</span>
31
+ <span class="n">groupdocs</span><span class="o">.</span><span class="n">api_server</span> <span class="o">=</span> <span class="s1">&#39;https://api.groupdocs.com&#39;</span>
33
32
  <span class="k">end</span>
34
33
  <span class="n">data</span><span class="o">.</span><span class="n">each</span> <span class="k">do</span> <span class="o">|</span><span class="n">key</span><span class="p">,</span> <span class="n">value</span><span class="o">|</span>
35
34
  <span class="k">if</span> <span class="n">key</span> <span class="o">==</span> <span class="s1">&#39;SourceId&#39;</span>
36
35
 
37
36
  <span class="n">envelope</span> <span class="o">=</span> <span class="ss">GroupDocs</span><span class="p">:</span><span class="ss">:Signature</span><span class="o">::</span><span class="no">Envelope</span><span class="o">.</span><span class="n">new</span> <span class="nb">id</span><span class="p">:</span> <span class="n">value</span><span class="p">,</span>
38
- <span class="nb">name</span><span class="p">:</span> <span class="n">value</span>
37
+ <span class="nb">name</span><span class="p">:</span> <span class="n">value</span>
39
38
 
40
39
  <span class="n">envelope</span><span class="o">.</span><span class="n">signed_documents!</span> <span class="s1">&#39;.&#39;</span>
41
40
  <span class="k">end</span>
@@ -50,7 +49,7 @@
50
49
  <span class="k">if</span> <span class="no">File</span><span class="o">.</span><span class="n">exist?</span><span class="p">(</span><span class="s1">&#39;signed&#39;</span><span class="p">)</span>
51
50
  <span class="no">File</span><span class="o">.</span><span class="n">readlines</span><span class="p">(</span><span class="s1">&#39;signed&#39;</span><span class="p">)</span><span class="o">.</span><span class="n">each</span> <span class="k">do</span> <span class="o">|</span><span class="n">line</span><span class="o">|</span>
52
51
  <span class="k">end</span>
53
- <span class="k">else</span>
52
+ <span class="k">else</span>
54
53
  <span class="s1">&#39;Have not signed yet&#39;</span>
55
54
  <span class="k">end</span>
56
55
  <span class="k">end</span>
@@ -61,41 +60,41 @@
61
60
  <span class="n">set</span> <span class="ss">:private_key</span><span class="p">,</span> <span class="n">params</span><span class="o">[</span><span class="ss">:private_key</span><span class="o">]</span>
62
61
 
63
62
  <span class="k">begin</span>
64
- <span class="k">raise</span> <span class="s2">&quot;Please enter all required parameters&quot;</span> <span class="k">if</span> <span class="n">settings</span><span class="o">.</span><span class="n">client_id</span><span class="o">.</span><span class="n">empty?</span> <span class="ow">or</span> <span class="n">settings</span><span class="o">.</span><span class="n">private_key</span><span class="o">.</span><span class="n">empty?</span>
63
+ <span class="k">raise</span> <span class="s1">&#39;Please enter all required parameters&#39;</span> <span class="k">if</span> <span class="n">settings</span><span class="o">.</span><span class="n">client_id</span><span class="o">.</span><span class="n">empty?</span> <span class="ow">or</span> <span class="n">settings</span><span class="o">.</span><span class="n">private_key</span><span class="o">.</span><span class="n">empty?</span>
65
64
 
66
65
  <span class="no">GroupDocs</span><span class="o">.</span><span class="n">configure</span> <span class="k">do</span> <span class="o">|</span><span class="n">groupdocs</span><span class="o">|</span>
67
66
  <span class="n">groupdocs</span><span class="o">.</span><span class="n">client_id</span> <span class="o">=</span> <span class="n">params</span><span class="o">[</span><span class="ss">:client_id</span><span class="o">]</span>
68
67
  <span class="n">groupdocs</span><span class="o">.</span><span class="n">private_key</span> <span class="o">=</span> <span class="n">params</span><span class="o">[</span><span class="ss">:private_key</span><span class="o">]</span>
69
- <span class="n">groupdocs</span><span class="o">.</span><span class="n">api_server</span> <span class="o">=</span> <span class="s1">&#39;https://api.groupdocs.com&#39;</span>
68
+ <span class="n">groupdocs</span><span class="o">.</span><span class="n">api_server</span> <span class="o">=</span> <span class="s1">&#39;https://stage-api.groupdocs.com&#39;</span>
70
69
  <span class="k">end</span>
71
-
70
+
72
71
 
73
72
  <span class="n">filepath</span> <span class="o">=</span> <span class="s2">&quot;</span><span class="si">#{</span><span class="no">Dir</span><span class="o">.</span><span class="n">tmpdir</span><span class="si">}</span><span class="s2">/</span><span class="si">#{</span><span class="n">params</span><span class="o">[</span><span class="ss">:file</span><span class="o">][</span><span class="ss">:filename</span><span class="o">]</span><span class="si">}</span><span class="s2">&quot;</span>
74
73
  <span class="no">File</span><span class="o">.</span><span class="n">open</span><span class="p">(</span><span class="n">filepath</span><span class="p">,</span> <span class="s1">&#39;wb&#39;</span><span class="p">)</span> <span class="p">{</span> <span class="o">|</span><span class="n">f</span><span class="o">|</span> <span class="n">f</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="n">params</span><span class="o">[</span><span class="ss">:file</span><span class="o">][</span><span class="ss">:tempfile</span><span class="o">].</span><span class="n">read</span><span class="p">)</span> <span class="p">}</span>
75
74
  <span class="n">file</span> <span class="o">=</span> <span class="ss">GroupDocs</span><span class="p">:</span><span class="ss">:Storage</span><span class="o">::</span><span class="no">File</span><span class="o">.</span><span class="n">upload!</span><span class="p">(</span><span class="n">filepath</span><span class="p">,</span> <span class="p">{},</span> <span class="n">client_id</span><span class="p">:</span> <span class="n">settings</span><span class="o">.</span><span class="n">client_id</span><span class="p">,</span> <span class="n">private_key</span><span class="p">:</span> <span class="n">settings</span><span class="o">.</span><span class="n">private_key</span><span class="p">)</span>
76
75
  <span class="n">document</span> <span class="o">=</span> <span class="n">file</span><span class="o">.</span><span class="n">to_document</span>
77
-
76
+
78
77
 
79
78
  <span class="n">envelope</span> <span class="o">=</span> <span class="ss">GroupDocs</span><span class="p">:</span><span class="ss">:Signature</span><span class="o">::</span><span class="no">Envelope</span><span class="o">.</span><span class="n">new</span>
80
- <span class="n">envelope</span><span class="o">.</span><span class="n">name</span> <span class="o">=</span> <span class="s2">&quot;Envelope&quot;</span>
81
- <span class="n">envelope</span><span class="o">.</span><span class="n">email_subject</span> <span class="o">=</span> <span class="s2">&quot;Sing this!&quot;</span>
79
+ <span class="n">envelope</span><span class="o">.</span><span class="n">name</span> <span class="o">=</span> <span class="s1">&#39;Envelope&#39;</span>
80
+ <span class="n">envelope</span><span class="o">.</span><span class="n">email_subject</span> <span class="o">=</span> <span class="s1">&#39;Sing this!&#39;</span>
82
81
  <span class="n">envelope</span><span class="o">.</span><span class="n">create!</span>
83
-
82
+
84
83
 
85
84
  <span class="n">envelope</span><span class="o">.</span><span class="n">add_document!</span> <span class="n">document</span>
86
-
85
+
87
86
 
88
87
  <span class="n">document</span> <span class="o">=</span> <span class="n">envelope</span><span class="o">.</span><span class="n">documents!</span><span class="o">.</span><span class="n">first</span>
89
-
88
+
90
89
 
91
90
  <span class="n">roles</span> <span class="o">=</span> <span class="ss">GroupDocs</span><span class="p">:</span><span class="ss">:Signature</span><span class="o">::</span><span class="no">Role</span><span class="o">.</span><span class="n">get!</span>
92
91
  <span class="n">recipient</span> <span class="o">=</span> <span class="ss">GroupDocs</span><span class="p">:</span><span class="ss">:Signature</span><span class="o">::</span><span class="no">Recipient</span><span class="o">.</span><span class="n">new</span>
93
92
  <span class="n">recipient</span><span class="o">.</span><span class="n">email</span> <span class="o">=</span> <span class="s1">&#39;john@smith.com&#39;</span>
94
93
  <span class="n">recipient</span><span class="o">.</span><span class="n">first_name</span> <span class="o">=</span> <span class="s1">&#39;John&#39;</span>
95
94
  <span class="n">recipient</span><span class="o">.</span><span class="n">last_name</span> <span class="o">=</span> <span class="s1">&#39;Smith&#39;</span>
96
- <span class="n">recipient</span><span class="o">.</span><span class="n">role_id</span> <span class="o">=</span> <span class="n">roles</span><span class="o">.</span><span class="n">detect</span> <span class="p">{</span> <span class="o">|</span><span class="n">role</span><span class="o">|</span> <span class="n">role</span><span class="o">.</span><span class="n">name</span> <span class="o">==</span> <span class="s2">&quot;Signer&quot;</span> <span class="p">}</span><span class="o">.</span><span class="n">id</span>
95
+ <span class="n">recipient</span><span class="o">.</span><span class="n">role_id</span> <span class="o">=</span> <span class="n">roles</span><span class="o">.</span><span class="n">detect</span> <span class="p">{</span> <span class="o">|</span><span class="n">role</span><span class="o">|</span> <span class="n">role</span><span class="o">.</span><span class="n">name</span> <span class="o">==</span> <span class="s1">&#39;Signer&#39;</span> <span class="p">}</span><span class="o">.</span><span class="n">id</span>
97
96
  <span class="n">envelope</span><span class="o">.</span><span class="n">add_recipient!</span> <span class="n">recipient</span>
98
-
97
+
99
98
 
100
99
  <span class="n">recipient</span> <span class="o">=</span> <span class="n">envelope</span><span class="o">.</span><span class="n">recipients!</span><span class="o">.</span><span class="n">first</span>
101
100
 
@@ -106,27 +105,28 @@ field = GroupDocs::Signature::Field.get!.detect { |f| f.type == :single<em>line
106
105
  field.name = 'City'
107
106
  field.location = { location</em>x: 0.3, location<em>y: 0.2, page: 1 }
108
107
  envelope.add</em>field! field, document, recipient</p> </td> <td class="code"> <div class="highlight"><pre>
109
-
108
+
110
109
 
111
110
  field = GroupDocs::Signature::Field.get!.detect { |f| f.type == :signature }
112
111
  field.location = { location<em>x: 0.3, location</em>y: 0.3, page: 1 }
113
112
  envelope.add_field! field, document, recipient</p> </td> <td class="code"> <div class="highlight"><pre>
114
113
 
115
-
116
- <span class="n">webhook</span> <span class="o">=</span> <span class="s1">&#39;http://groupdocs-ruby-samples.herokuapp.com/envelope-sample/sign&#39;</span>
114
+
115
+ webhook = 'http://groupdocs-ruby-samples.herokuapp.com/envelope-sample/sign'</p> </td> <td class="code"> <div class="highlight"><pre>
116
+ <span class="n">webhook</span> <span class="o">=</span> <span class="s1">&#39;http://77.81.243.48/?q=groupdocs_signature/signature_callback&#39;</span>
117
117
 
118
118
 
119
119
  <span class="n">envelope</span><span class="o">.</span><span class="n">send!</span> <span class="n">webhook</span>
120
-
120
+
121
121
 
122
- <span class="n">url</span> <span class="o">=</span> <span class="s2">&quot;https://apps.groupdocs.com/signature/signembed/</span><span class="si">#{</span><span class="n">envelope</span><span class="o">.</span><span class="n">id</span><span class="si">}</span><span class="s2">/</span><span class="si">#{</span><span class="n">recipient</span><span class="o">.</span><span class="n">id</span><span class="si">}</span><span class="s2">&quot;</span>
122
+ <span class="n">url</span> <span class="o">=</span> <span class="s2">&quot;https://stage-apps.groupdocs.com/signature/signembed/</span><span class="si">#{</span><span class="n">envelope</span><span class="o">.</span><span class="n">id</span><span class="si">}</span><span class="s2">/</span><span class="si">#{</span><span class="n">recipient</span><span class="o">.</span><span class="n">id</span><span class="si">}</span><span class="s2">&quot;</span>
123
123
  <span class="n">iframe</span> <span class="o">=</span> <span class="s2">&quot;&lt;iframe src=&#39;</span><span class="si">#{</span><span class="n">url</span><span class="si">}</span><span class="s2">&#39; frameborder=&#39;0&#39; width=&#39;720&#39; height=&#39;600&#39;&gt;&lt;/iframe&gt;&quot;</span>
124
124
 
125
125
  <span class="k">rescue</span> <span class="no">Exception</span> <span class="o">=&gt;</span> <span class="n">e</span>
126
126
  <span class="n">err</span> <span class="o">=</span> <span class="n">e</span><span class="o">.</span><span class="n">message</span>
127
127
  <span class="k">end</span>
128
128
 
129
- <span class="n">haml</span> <span class="ss">:envelope_sample</span><span class="p">,</span> <span class="ss">:locals</span> <span class="o">=&gt;</span> <span class="p">{</span> <span class="ss">:client_id</span> <span class="o">=&gt;</span> <span class="n">settings</span><span class="o">.</span><span class="n">client_id</span><span class="p">,</span> <span class="ss">:private_key</span> <span class="o">=&gt;</span> <span class="n">settings</span><span class="o">.</span><span class="n">private_key</span><span class="p">,</span> <span class="ss">:err</span> <span class="o">=&gt;</span> <span class="n">err</span><span class="p">,</span> <span class="ss">:iframe</span> <span class="o">=&gt;</span> <span class="n">iframe</span><span class="p">}</span>
129
+ <span class="n">haml</span> <span class="ss">:envelope_sample</span><span class="p">,</span> <span class="ss">:locals</span> <span class="o">=&gt;</span> <span class="p">{</span><span class="ss">:client_id</span> <span class="o">=&gt;</span> <span class="n">settings</span><span class="o">.</span><span class="n">client_id</span><span class="p">,</span> <span class="ss">:private_key</span> <span class="o">=&gt;</span> <span class="n">settings</span><span class="o">.</span><span class="n">private_key</span><span class="p">,</span> <span class="ss">:err</span> <span class="o">=&gt;</span> <span class="n">err</span><span class="p">,</span> <span class="ss">:iframe</span> <span class="o">=&gt;</span> <span class="n">iframe</span><span class="p">}</span>
130
130
  <span class="k">end</span>
131
131
 
132
132
  </pre></div> </td> </tr> </tbody> </table> </div> </body> </html>
@@ -1,4 +1,4 @@
1
- <!DOCTYPE html> <html> <head> <title>sample1.rb</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <link rel="stylesheet" media="all" href="docco.css" /> </head> <body> <div id="container"> <div id="background"></div> <div id="jump_to"> Jump To &hellip; <div id="jump_wrapper"> <div id="jump_page"> <a class="source" href="envelope-sample.html"> envelope-sample.rb </a> <a class="source" href="sample1.html"> sample1.rb </a> <a class="source" href="sample10.html"> sample10.rb </a> <a class="source" href="sample11.html"> sample11.rb </a> <a class="source" href="sample12.html"> sample12.rb </a> <a class="source" href="sample13.html"> sample13.rb </a> <a class="source" href="sample14.html"> sample14.rb </a> <a class="source" href="sample15.html"> sample15.rb </a> <a class="source" href="sample16.html"> sample16.rb </a> <a class="source" href="sample17.html"> sample17.rb </a> <a class="source" href="sample18.html"> sample18.rb </a> <a class="source" href="sample2.html"> sample2.rb </a> <a class="source" href="sample3.html"> sample3.rb </a> <a class="source" href="sample4.html"> sample4.rb </a> <a class="source" href="sample5.html"> sample5.rb </a> <a class="source" href="sample6.html"> sample6.rb </a> <a class="source" href="sample7.html"> sample7.rb </a> <a class="source" href="sample8.html"> sample8.rb </a> <a class="source" href="sample9.html"> sample9.rb </a> </div> </div> </div> <table cellpadding="0" cellspacing="0"> <thead> <tr> <th class="docs"> <h1> sample1.rb </h1> </th> <th class="code"> </th> </tr> </thead> <tbody> <tr id="section-1"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-1">&#182;</a> </div> <p>GET request</p> </td> <td class="code"> <div class="highlight"><pre><span class="n">get</span> <span class="s1">&#39;/sample1&#39;</span> <span class="k">do</span>
1
+ <!DOCTYPE html> <html> <head> <title>sample1.rb</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <link rel="stylesheet" media="all" href="docco.css" /> </head> <body> <div id="container"> <div id="background"></div> <div id="jump_to"> Jump To &hellip; <div id="jump_wrapper"> <div id="jump_page"> <a class="source" href="annotation-sample.html"> annotation-sample.rb </a> <a class="source" href="envelope-sample.html"> envelope-sample.rb </a> <a class="source" href="sample1.html"> sample1.rb </a> <a class="source" href="sample10.html"> sample10.rb </a> <a class="source" href="sample11.html"> sample11.rb </a> <a class="source" href="sample12.html"> sample12.rb </a> <a class="source" href="sample13.html"> sample13.rb </a> <a class="source" href="sample14.html"> sample14.rb </a> <a class="source" href="sample15.html"> sample15.rb </a> <a class="source" href="sample16.html"> sample16.rb </a> <a class="source" href="sample17.html"> sample17.rb </a> <a class="source" href="sample18.html"> sample18.rb </a> <a class="source" href="sample19.html"> sample19.rb </a> <a class="source" href="sample2.html"> sample2.rb </a> <a class="source" href="sample20.html"> sample20.rb </a> <a class="source" href="sample21.html"> sample21.rb </a> <a class="source" href="sample22.html"> sample22.rb </a> <a class="source" href="sample3.html"> sample3.rb </a> <a class="source" href="sample4.html"> sample4.rb </a> <a class="source" href="sample5.html"> sample5.rb </a> <a class="source" href="sample6.html"> sample6.rb </a> <a class="source" href="sample7.html"> sample7.rb </a> <a class="source" href="sample8.html"> sample8.rb </a> <a class="source" href="sample9.html"> sample9.rb </a> </div> </div> </div> <table cellpadding="0" cellspacing="0"> <thead> <tr> <th class="docs"> <h1> sample1.rb </h1> </th> <th class="code"> </th> </tr> </thead> <tbody> <tr id="section-1"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-1">&#182;</a> </div> <p>GET request</p> </td> <td class="code"> <div class="highlight"><pre><span class="n">get</span> <span class="s1">&#39;/sample1&#39;</span> <span class="k">do</span>
2
2
  <span class="n">haml</span> <span class="ss">:sample1</span>
3
3
  <span class="k">end</span>
4
4
 
@@ -10,7 +10,7 @@
10
10
 
11
11
  <span class="k">begin</span>
12
12
 
13
- <span class="k">raise</span> <span class="s2">&quot;Please enter all required parameters&quot;</span> <span class="k">if</span> <span class="n">settings</span><span class="o">.</span><span class="n">client_id</span><span class="o">.</span><span class="n">empty?</span> <span class="ow">or</span> <span class="n">settings</span><span class="o">.</span><span class="n">private_key</span><span class="o">.</span><span class="n">empty?</span>
13
+ <span class="k">raise</span> <span class="s1">&#39;Please enter all required parameters&#39;</span> <span class="k">if</span> <span class="n">settings</span><span class="o">.</span><span class="n">client_id</span><span class="o">.</span><span class="n">empty?</span> <span class="ow">or</span> <span class="n">settings</span><span class="o">.</span><span class="n">private_key</span><span class="o">.</span><span class="n">empty?</span>
14
14
 
15
15
 
16
16
  <span class="n">user</span> <span class="o">=</span> <span class="ss">GroupDocs</span><span class="p">:</span><span class="ss">:User</span><span class="o">.</span><span class="n">get!</span><span class="p">({</span><span class="ss">:client_id</span> <span class="o">=&gt;</span> <span class="n">settings</span><span class="o">.</span><span class="n">client_id</span><span class="p">,</span> <span class="ss">:private_key</span> <span class="o">=&gt;</span> <span class="n">settings</span><span class="o">.</span><span class="n">private_key</span><span class="p">})</span>
@@ -20,7 +20,7 @@
20
20
  <span class="k">end</span>
21
21
 
22
22
 
23
- <span class="n">haml</span> <span class="ss">:sample1</span><span class="p">,</span> <span class="ss">:locals</span> <span class="o">=&gt;</span> <span class="p">{</span> <span class="ss">:userId</span> <span class="o">=&gt;</span> <span class="n">settings</span><span class="o">.</span><span class="n">client_id</span><span class="p">,</span> <span class="ss">:privateKey</span> <span class="o">=&gt;</span> <span class="n">settings</span><span class="o">.</span><span class="n">private_key</span><span class="p">,</span> <span class="ss">:user</span> <span class="o">=&gt;</span> <span class="n">user</span><span class="p">,</span> <span class="ss">:err</span> <span class="o">=&gt;</span> <span class="n">err</span> <span class="p">}</span>
23
+ <span class="n">haml</span> <span class="ss">:sample1</span><span class="p">,</span> <span class="ss">:locals</span> <span class="o">=&gt;</span> <span class="p">{</span><span class="ss">:userId</span> <span class="o">=&gt;</span> <span class="n">settings</span><span class="o">.</span><span class="n">client_id</span><span class="p">,</span> <span class="ss">:privateKey</span> <span class="o">=&gt;</span> <span class="n">settings</span><span class="o">.</span><span class="n">private_key</span><span class="p">,</span> <span class="ss">:user</span> <span class="o">=&gt;</span> <span class="n">user</span><span class="p">,</span> <span class="ss">:err</span> <span class="o">=&gt;</span> <span class="n">err</span><span class="p">}</span>
24
24
  <span class="k">end</span>
25
25
 
26
26
  </pre></div> </td> </tr> </tbody> </table> </div> </body> </html>
@@ -1,4 +1,4 @@
1
- <!DOCTYPE html> <html> <head> <title>sample10.rb</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <link rel="stylesheet" media="all" href="docco.css" /> </head> <body> <div id="container"> <div id="background"></div> <div id="jump_to"> Jump To &hellip; <div id="jump_wrapper"> <div id="jump_page"> <a class="source" href="envelope-sample.html"> envelope-sample.rb </a> <a class="source" href="sample1.html"> sample1.rb </a> <a class="source" href="sample10.html"> sample10.rb </a> <a class="source" href="sample11.html"> sample11.rb </a> <a class="source" href="sample12.html"> sample12.rb </a> <a class="source" href="sample13.html"> sample13.rb </a> <a class="source" href="sample14.html"> sample14.rb </a> <a class="source" href="sample15.html"> sample15.rb </a> <a class="source" href="sample16.html"> sample16.rb </a> <a class="source" href="sample17.html"> sample17.rb </a> <a class="source" href="sample18.html"> sample18.rb </a> <a class="source" href="sample2.html"> sample2.rb </a> <a class="source" href="sample3.html"> sample3.rb </a> <a class="source" href="sample4.html"> sample4.rb </a> <a class="source" href="sample5.html"> sample5.rb </a> <a class="source" href="sample6.html"> sample6.rb </a> <a class="source" href="sample7.html"> sample7.rb </a> <a class="source" href="sample8.html"> sample8.rb </a> <a class="source" href="sample9.html"> sample9.rb </a> </div> </div> </div> <table cellpadding="0" cellspacing="0"> <thead> <tr> <th class="docs"> <h1> sample10.rb </h1> </th> <th class="code"> </th> </tr> </thead> <tbody> <tr id="section-1"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-1">&#182;</a> </div> <p>GET request</p> </td> <td class="code"> <div class="highlight"><pre><span class="n">get</span> <span class="s1">&#39;/sample10&#39;</span> <span class="k">do</span>
1
+ <!DOCTYPE html> <html> <head> <title>sample10.rb</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <link rel="stylesheet" media="all" href="docco.css" /> </head> <body> <div id="container"> <div id="background"></div> <div id="jump_to"> Jump To &hellip; <div id="jump_wrapper"> <div id="jump_page"> <a class="source" href="annotation-sample.html"> annotation-sample.rb </a> <a class="source" href="envelope-sample.html"> envelope-sample.rb </a> <a class="source" href="sample1.html"> sample1.rb </a> <a class="source" href="sample10.html"> sample10.rb </a> <a class="source" href="sample11.html"> sample11.rb </a> <a class="source" href="sample12.html"> sample12.rb </a> <a class="source" href="sample13.html"> sample13.rb </a> <a class="source" href="sample14.html"> sample14.rb </a> <a class="source" href="sample15.html"> sample15.rb </a> <a class="source" href="sample16.html"> sample16.rb </a> <a class="source" href="sample17.html"> sample17.rb </a> <a class="source" href="sample18.html"> sample18.rb </a> <a class="source" href="sample19.html"> sample19.rb </a> <a class="source" href="sample2.html"> sample2.rb </a> <a class="source" href="sample20.html"> sample20.rb </a> <a class="source" href="sample21.html"> sample21.rb </a> <a class="source" href="sample22.html"> sample22.rb </a> <a class="source" href="sample3.html"> sample3.rb </a> <a class="source" href="sample4.html"> sample4.rb </a> <a class="source" href="sample5.html"> sample5.rb </a> <a class="source" href="sample6.html"> sample6.rb </a> <a class="source" href="sample7.html"> sample7.rb </a> <a class="source" href="sample8.html"> sample8.rb </a> <a class="source" href="sample9.html"> sample9.rb </a> </div> </div> </div> <table cellpadding="0" cellspacing="0"> <thead> <tr> <th class="docs"> <h1> sample10.rb </h1> </th> <th class="code"> </th> </tr> </thead> <tbody> <tr id="section-1"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-1">&#182;</a> </div> <p>GET request</p> </td> <td class="code"> <div class="highlight"><pre><span class="n">get</span> <span class="s1">&#39;/sample10&#39;</span> <span class="k">do</span>
2
2
  <span class="n">haml</span> <span class="ss">:sample10</span>
3
3
  <span class="k">end</span>
4
4
 
@@ -7,34 +7,35 @@
7
7
 
8
8
  <span class="n">set</span> <span class="ss">:client_id</span><span class="p">,</span> <span class="n">params</span><span class="o">[</span><span class="ss">:client_id</span><span class="o">]</span>
9
9
  <span class="n">set</span> <span class="ss">:private_key</span><span class="p">,</span> <span class="n">params</span><span class="o">[</span><span class="ss">:private_key</span><span class="o">]</span>
10
- <span class="n">set</span> <span class="ss">:guid</span><span class="p">,</span> <span class="n">params</span><span class="o">[</span><span class="ss">:guid</span><span class="o">]</span>
10
+ <span class="n">set</span> <span class="ss">:guid</span><span class="p">,</span> <span class="n">params</span><span class="o">[</span><span class="ss">:fileId</span><span class="o">]</span>
11
11
  <span class="n">set</span> <span class="ss">:email</span><span class="p">,</span> <span class="n">params</span><span class="o">[</span><span class="ss">:email</span><span class="o">]</span>
12
12
 
13
13
  <span class="k">begin</span>
14
14
 
15
- <span class="k">raise</span> <span class="s2">&quot;Please enter all required parameters&quot;</span> <span class="k">if</span> <span class="n">settings</span><span class="o">.</span><span class="n">client_id</span><span class="o">.</span><span class="n">empty?</span> <span class="ow">or</span> <span class="n">settings</span><span class="o">.</span><span class="n">private_key</span><span class="o">.</span><span class="n">empty?</span> <span class="ow">or</span> <span class="n">settings</span><span class="o">.</span><span class="n">guid</span><span class="o">.</span><span class="n">empty?</span> <span class="ow">or</span> <span class="n">settings</span><span class="o">.</span><span class="n">email</span><span class="o">.</span><span class="n">empty?</span>
16
-
17
-
18
- <span class="n">files_list</span> <span class="o">=</span> <span class="ss">GroupDocs</span><span class="p">:</span><span class="ss">:Storage</span><span class="o">::</span><span class="no">Folder</span><span class="o">.</span><span class="n">list!</span><span class="p">(</span><span class="s1">&#39;/&#39;</span><span class="p">,</span> <span class="p">{},</span> <span class="p">{</span> <span class="ss">:client_id</span> <span class="o">=&gt;</span> <span class="n">settings</span><span class="o">.</span><span class="n">client_id</span><span class="p">,</span> <span class="ss">:private_key</span> <span class="o">=&gt;</span> <span class="n">settings</span><span class="o">.</span><span class="n">private_key</span><span class="p">})</span>
19
-
20
- <span class="nb">name</span> <span class="o">=</span> <span class="kp">nil</span>
21
- <span class="n">doc</span> <span class="o">=</span> <span class="kp">nil</span>
22
- <span class="n">files_list</span><span class="o">.</span><span class="n">each</span> <span class="k">do</span> <span class="o">|</span><span class="n">element</span><span class="o">|</span>
23
- <span class="k">if</span> <span class="n">element</span><span class="o">.</span><span class="n">class</span><span class="o">.</span><span class="n">name</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s1">&#39;::&#39;</span><span class="p">)</span><span class="o">.</span><span class="n">last</span> <span class="o">==</span> <span class="s1">&#39;Folder&#39;</span>
24
- <span class="k">next</span>
25
- <span class="k">end</span>
26
-
27
-
28
- <span class="k">if</span> <span class="n">element</span><span class="o">.</span><span class="n">guid</span> <span class="o">==</span> <span class="n">settings</span><span class="o">.</span><span class="n">guid</span>
29
- <span class="nb">name</span> <span class="o">=</span> <span class="n">element</span><span class="o">.</span><span class="n">name</span>
30
- <span class="n">doc</span> <span class="o">=</span> <span class="n">element</span>
31
- <span class="k">end</span>
15
+ <span class="k">raise</span> <span class="s1">&#39;Please enter all required parameters&#39;</span> <span class="k">if</span> <span class="n">settings</span><span class="o">.</span><span class="n">client_id</span><span class="o">.</span><span class="n">empty?</span> <span class="ow">or</span> <span class="n">settings</span><span class="o">.</span><span class="n">private_key</span><span class="o">.</span><span class="n">empty?</span> <span class="ow">or</span> <span class="n">settings</span><span class="o">.</span><span class="n">guid</span><span class="o">.</span><span class="n">empty?</span> <span class="ow">or</span> <span class="n">settings</span><span class="o">.</span><span class="n">email</span><span class="o">.</span><span class="n">empty?</span>
16
+
17
+
18
+ <span class="n">file</span> <span class="o">=</span> <span class="kp">nil</span>
19
+ <span class="k">case</span> <span class="n">settings</span><span class="o">.</span><span class="n">source</span>
20
+ <span class="k">when</span> <span class="s1">&#39;guid&#39;</span>
21
+ <span class="n">file</span> <span class="o">=</span> <span class="ss">GroupDocs</span><span class="p">:</span><span class="ss">:Storage</span><span class="o">::</span><span class="no">File</span><span class="o">.</span><span class="n">new</span><span class="p">({</span><span class="ss">:guid</span> <span class="o">=&gt;</span> <span class="n">settings</span><span class="o">.</span><span class="n">guid</span><span class="p">})</span>
22
+ <span class="k">when</span> <span class="s1">&#39;local&#39;</span>
23
+
24
+ <span class="n">filepath</span> <span class="o">=</span> <span class="s2">&quot;</span><span class="si">#{</span><span class="no">Dir</span><span class="o">.</span><span class="n">tmpdir</span><span class="si">}</span><span class="s2">/</span><span class="si">#{</span><span class="n">params</span><span class="o">[</span><span class="ss">:file</span><span class="o">][</span><span class="ss">:filename</span><span class="o">]</span><span class="si">}</span><span class="s2">&quot;</span>
25
+
26
+ <span class="no">File</span><span class="o">.</span><span class="n">open</span><span class="p">(</span><span class="n">filepath</span><span class="p">,</span> <span class="s1">&#39;wb&#39;</span><span class="p">)</span> <span class="p">{</span> <span class="o">|</span><span class="n">f</span><span class="o">|</span> <span class="n">f</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="n">params</span><span class="o">[</span><span class="ss">:file</span><span class="o">][</span><span class="ss">:tempfile</span><span class="o">].</span><span class="n">read</span><span class="p">)</span> <span class="p">}</span>
27
+
28
+ <span class="n">file</span> <span class="o">=</span> <span class="ss">GroupDocs</span><span class="p">:</span><span class="ss">:Storage</span><span class="o">::</span><span class="no">File</span><span class="o">.</span><span class="n">upload!</span><span class="p">(</span><span class="n">filepath</span><span class="p">,</span> <span class="p">{},</span> <span class="n">client_id</span><span class="p">:</span> <span class="n">settings</span><span class="o">.</span><span class="n">client_id</span><span class="p">,</span> <span class="n">private_key</span><span class="p">:</span> <span class="n">settings</span><span class="o">.</span><span class="n">private_key</span><span class="p">)</span>
29
+ <span class="k">when</span> <span class="s1">&#39;url&#39;</span>
30
+ <span class="n">file</span> <span class="o">=</span> <span class="ss">GroupDocs</span><span class="p">:</span><span class="ss">:Storage</span><span class="o">::</span><span class="no">File</span><span class="o">.</span><span class="n">upload_web!</span><span class="p">(</span><span class="n">settings</span><span class="o">.</span><span class="n">url</span><span class="p">,</span> <span class="n">client_id</span><span class="p">:</span> <span class="n">settings</span><span class="o">.</span><span class="n">client_id</span><span class="p">,</span> <span class="n">private_key</span><span class="p">:</span> <span class="n">settings</span><span class="o">.</span><span class="n">private_key</span><span class="p">)</span>
31
+ <span class="k">else</span>
32
+ <span class="k">raise</span> <span class="s1">&#39;Wrong GUID source.&#39;</span>
32
33
  <span class="k">end</span>
33
34
 
34
-
35
- <span class="n">shared</span> <span class="o">=</span> <span class="n">doc</span><span class="o">.</span><span class="n">to_document</span><span class="o">.</span><span class="n">sharers_set!</span><span class="p">(</span><span class="n">settings</span><span class="o">.</span><span class="n">email</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s2">&quot; &quot;</span><span class="p">),</span> <span class="p">{</span> <span class="ss">:client_id</span> <span class="o">=&gt;</span> <span class="n">settings</span><span class="o">.</span><span class="n">client_id</span><span class="p">,</span> <span class="ss">:private_key</span> <span class="o">=&gt;</span> <span class="n">settings</span><span class="o">.</span><span class="n">private_key</span><span class="p">});</span>
35
+
36
+ <span class="n">shared</span> <span class="o">=</span> <span class="n">file</span><span class="o">.</span><span class="n">to_document</span><span class="o">.</span><span class="n">sharers_set!</span><span class="p">(</span><span class="n">settings</span><span class="o">.</span><span class="n">email</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s1">&#39; &#39;</span><span class="p">),</span> <span class="p">{</span><span class="ss">:client_id</span> <span class="o">=&gt;</span> <span class="n">settings</span><span class="o">.</span><span class="n">client_id</span><span class="p">,</span> <span class="ss">:private_key</span> <span class="o">=&gt;</span> <span class="n">settings</span><span class="o">.</span><span class="n">private_key</span><span class="p">})</span>
36
37
 
37
-
38
+
38
39
  <span class="k">if</span> <span class="n">shared</span>
39
40
  <span class="n">shared_emails</span> <span class="o">=</span> <span class="n">settings</span><span class="o">.</span><span class="n">email</span>
40
41
  <span class="k">end</span>
@@ -42,8 +43,8 @@
42
43
  <span class="n">err</span> <span class="o">=</span> <span class="n">e</span><span class="o">.</span><span class="n">message</span>
43
44
  <span class="k">end</span>
44
45
 
45
-
46
- <span class="n">haml</span> <span class="ss">:sample10</span><span class="p">,</span> <span class="ss">:locals</span> <span class="o">=&gt;</span> <span class="p">{</span> <span class="ss">:client_id</span> <span class="o">=&gt;</span> <span class="n">settings</span><span class="o">.</span><span class="n">client_id</span><span class="p">,</span> <span class="ss">:private_key</span> <span class="o">=&gt;</span> <span class="n">settings</span><span class="o">.</span><span class="n">private_key</span><span class="p">,</span> <span class="ss">:guid</span> <span class="o">=&gt;</span> <span class="n">settings</span><span class="o">.</span><span class="n">guid</span><span class="p">,</span> <span class="ss">:email</span><span class="o">=&gt;</span><span class="n">settings</span><span class="o">.</span><span class="n">email</span><span class="p">,</span> <span class="ss">:shared</span> <span class="o">=&gt;</span> <span class="n">shared_emails</span><span class="p">,</span> <span class="ss">:err</span> <span class="o">=&gt;</span> <span class="n">err</span> <span class="p">}</span>
46
+
47
+ <span class="n">haml</span> <span class="ss">:sample10</span><span class="p">,</span> <span class="ss">:locals</span> <span class="o">=&gt;</span> <span class="p">{</span><span class="ss">:client_id</span> <span class="o">=&gt;</span> <span class="n">settings</span><span class="o">.</span><span class="n">client_id</span><span class="p">,</span> <span class="ss">:private_key</span> <span class="o">=&gt;</span> <span class="n">settings</span><span class="o">.</span><span class="n">private_key</span><span class="p">,</span> <span class="ss">:guid</span> <span class="o">=&gt;</span> <span class="n">settings</span><span class="o">.</span><span class="n">guid</span><span class="p">,</span> <span class="ss">:email</span> <span class="o">=&gt;</span> <span class="n">settings</span><span class="o">.</span><span class="n">email</span><span class="p">,</span> <span class="ss">:shared</span> <span class="o">=&gt;</span> <span class="n">shared_emails</span><span class="p">,</span> <span class="ss">:err</span> <span class="o">=&gt;</span> <span class="n">err</span><span class="p">}</span>
47
48
  <span class="k">end</span>
48
49
 
49
50
  </pre></div> </td> </tr> </tbody> </table> </div> </body> </html>
@@ -1,4 +1,4 @@
1
- <!DOCTYPE html> <html> <head> <title>sample11.rb</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <link rel="stylesheet" media="all" href="docco.css" /> </head> <body> <div id="container"> <div id="background"></div> <div id="jump_to"> Jump To &hellip; <div id="jump_wrapper"> <div id="jump_page"> <a class="source" href="envelope-sample.html"> envelope-sample.rb </a> <a class="source" href="sample1.html"> sample1.rb </a> <a class="source" href="sample10.html"> sample10.rb </a> <a class="source" href="sample11.html"> sample11.rb </a> <a class="source" href="sample12.html"> sample12.rb </a> <a class="source" href="sample13.html"> sample13.rb </a> <a class="source" href="sample14.html"> sample14.rb </a> <a class="source" href="sample15.html"> sample15.rb </a> <a class="source" href="sample16.html"> sample16.rb </a> <a class="source" href="sample17.html"> sample17.rb </a> <a class="source" href="sample18.html"> sample18.rb </a> <a class="source" href="sample2.html"> sample2.rb </a> <a class="source" href="sample3.html"> sample3.rb </a> <a class="source" href="sample4.html"> sample4.rb </a> <a class="source" href="sample5.html"> sample5.rb </a> <a class="source" href="sample6.html"> sample6.rb </a> <a class="source" href="sample7.html"> sample7.rb </a> <a class="source" href="sample8.html"> sample8.rb </a> <a class="source" href="sample9.html"> sample9.rb </a> </div> </div> </div> <table cellpadding="0" cellspacing="0"> <thead> <tr> <th class="docs"> <h1> sample11.rb </h1> </th> <th class="code"> </th> </tr> </thead> <tbody> <tr id="section-1"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-1">&#182;</a> </div> <p>GET request</p> </td> <td class="code"> <div class="highlight"><pre><span class="n">get</span> <span class="s1">&#39;/sample11&#39;</span> <span class="k">do</span>
1
+ <!DOCTYPE html> <html> <head> <title>sample11.rb</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <link rel="stylesheet" media="all" href="docco.css" /> </head> <body> <div id="container"> <div id="background"></div> <div id="jump_to"> Jump To &hellip; <div id="jump_wrapper"> <div id="jump_page"> <a class="source" href="annotation-sample.html"> annotation-sample.rb </a> <a class="source" href="envelope-sample.html"> envelope-sample.rb </a> <a class="source" href="sample1.html"> sample1.rb </a> <a class="source" href="sample10.html"> sample10.rb </a> <a class="source" href="sample11.html"> sample11.rb </a> <a class="source" href="sample12.html"> sample12.rb </a> <a class="source" href="sample13.html"> sample13.rb </a> <a class="source" href="sample14.html"> sample14.rb </a> <a class="source" href="sample15.html"> sample15.rb </a> <a class="source" href="sample16.html"> sample16.rb </a> <a class="source" href="sample17.html"> sample17.rb </a> <a class="source" href="sample18.html"> sample18.rb </a> <a class="source" href="sample19.html"> sample19.rb </a> <a class="source" href="sample2.html"> sample2.rb </a> <a class="source" href="sample20.html"> sample20.rb </a> <a class="source" href="sample21.html"> sample21.rb </a> <a class="source" href="sample22.html"> sample22.rb </a> <a class="source" href="sample3.html"> sample3.rb </a> <a class="source" href="sample4.html"> sample4.rb </a> <a class="source" href="sample5.html"> sample5.rb </a> <a class="source" href="sample6.html"> sample6.rb </a> <a class="source" href="sample7.html"> sample7.rb </a> <a class="source" href="sample8.html"> sample8.rb </a> <a class="source" href="sample9.html"> sample9.rb </a> </div> </div> </div> <table cellpadding="0" cellspacing="0"> <thead> <tr> <th class="docs"> <h1> sample11.rb </h1> </th> <th class="code"> </th> </tr> </thead> <tbody> <tr id="section-1"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-1">&#182;</a> </div> <p>GET request</p> </td> <td class="code"> <div class="highlight"><pre><span class="n">get</span> <span class="s1">&#39;/sample11&#39;</span> <span class="k">do</span>
2
2
  <span class="n">haml</span> <span class="ss">:sample11</span>
3
3
  <span class="k">end</span>
4
4
 
@@ -12,28 +12,28 @@
12
12
 
13
13
  <span class="k">begin</span>
14
14
 
15
- <span class="k">raise</span> <span class="s2">&quot;Please enter all required parameters&quot;</span> <span class="k">if</span> <span class="n">settings</span><span class="o">.</span><span class="n">client_id</span><span class="o">.</span><span class="n">empty?</span> <span class="ow">or</span> <span class="n">settings</span><span class="o">.</span><span class="n">private_key</span><span class="o">.</span><span class="n">empty?</span> <span class="ow">or</span> <span class="n">settings</span><span class="o">.</span><span class="n">file_id</span><span class="o">.</span><span class="n">empty?</span> <span class="ow">or</span> <span class="n">settings</span><span class="o">.</span><span class="n">annotation_type</span><span class="o">.</span><span class="n">empty?</span>
15
+ <span class="k">raise</span> <span class="s1">&#39;Please enter all required parameters&#39;</span> <span class="k">if</span> <span class="n">settings</span><span class="o">.</span><span class="n">client_id</span><span class="o">.</span><span class="n">empty?</span> <span class="ow">or</span> <span class="n">settings</span><span class="o">.</span><span class="n">private_key</span><span class="o">.</span><span class="n">empty?</span> <span class="ow">or</span> <span class="n">settings</span><span class="o">.</span><span class="n">file_id</span><span class="o">.</span><span class="n">empty?</span> <span class="ow">or</span> <span class="n">settings</span><span class="o">.</span><span class="n">annotation_type</span><span class="o">.</span><span class="n">empty?</span>
16
16
 
17
17
 
18
- <span class="n">types</span> <span class="o">=</span> <span class="p">{</span><span class="s1">&#39;text&#39;</span> <span class="o">=&gt;</span> <span class="mi">0</span><span class="p">,</span> <span class="s1">&#39;area&#39;</span> <span class="o">=&gt;</span> <span class="mi">1</span><span class="p">,</span> <span class="s1">&#39;point&#39;</span> <span class="o">=&gt;</span> <span class="mi">2</span><span class="p">}</span>
18
+ <span class="n">types</span> <span class="o">=</span> <span class="p">{</span><span class="ss">:text</span> <span class="o">=&gt;</span> <span class="mi">0</span><span class="p">,</span> <span class="ss">:area</span> <span class="o">=&gt;</span> <span class="mi">1</span><span class="p">,</span> <span class="ss">:point</span> <span class="o">=&gt;</span> <span class="mi">2</span><span class="p">}</span>
19
19
 
20
20
 
21
- <span class="n">allParams</span> <span class="o">=</span> <span class="n">allParams</span> <span class="o">=</span> <span class="o">[</span><span class="s1">&#39;annotation_type&#39;</span><span class="p">,</span> <span class="s1">&#39;box_x&#39;</span><span class="p">,</span> <span class="s1">&#39;box_y&#39;</span><span class="p">,</span> <span class="s1">&#39;text&#39;</span><span class="o">]</span>
21
+ <span class="n">all_params</span> <span class="o">=</span> <span class="n">all_params</span> <span class="o">=</span> <span class="o">[</span><span class="s1">&#39;annotation_type&#39;</span><span class="p">,</span> <span class="s1">&#39;box_x&#39;</span><span class="p">,</span> <span class="s1">&#39;box_y&#39;</span><span class="p">,</span> <span class="s1">&#39;text&#39;</span><span class="o">]</span>
22
22
 
23
23
 
24
- <span class="k">if</span> <span class="n">settings</span><span class="o">.</span><span class="n">annotation_type</span> <span class="o">==</span> <span class="s2">&quot;text&quot;</span>
25
- <span class="n">allParams</span> <span class="o">=</span> <span class="n">allParams</span> <span class="o">|</span> <span class="o">[</span><span class="s1">&#39;box_width&#39;</span><span class="p">,</span> <span class="s1">&#39;box_height&#39;</span><span class="p">,</span> <span class="s1">&#39;annotationPosition_x&#39;</span><span class="p">,</span> <span class="s1">&#39;annotationPosition_y&#39;</span><span class="o">]</span>
26
- <span class="k">elsif</span> <span class="n">settings</span><span class="o">.</span><span class="n">annotation_type</span> <span class="o">==</span> <span class="s2">&quot;area&quot;</span>
27
- <span class="n">allParams</span> <span class="o">=</span> <span class="n">allParams</span> <span class="o">|</span> <span class="o">[</span><span class="s1">&#39;box_width&#39;</span><span class="p">,</span> <span class="s1">&#39;box_height&#39;</span><span class="o">]</span>
24
+ <span class="k">if</span> <span class="n">settings</span><span class="o">.</span><span class="n">annotation_type</span> <span class="o">==</span> <span class="s1">&#39;text&#39;</span>
25
+ <span class="n">all_params</span> <span class="o">=</span> <span class="n">all_params</span> <span class="o">|</span> <span class="o">[</span><span class="s1">&#39;box_width&#39;</span><span class="p">,</span> <span class="s1">&#39;box_height&#39;</span><span class="p">,</span> <span class="s1">&#39;annotationPosition_x&#39;</span><span class="p">,</span> <span class="s1">&#39;annotationPosition_y&#39;</span><span class="o">]</span>
26
+ <span class="k">elsif</span> <span class="n">settings</span><span class="o">.</span><span class="n">annotation_type</span> <span class="o">==</span> <span class="s1">&#39;area&#39;</span>
27
+ <span class="n">all_params</span> <span class="o">=</span> <span class="n">all_params</span> <span class="o">|</span> <span class="o">[</span><span class="s1">&#39;box_width&#39;</span><span class="p">,</span> <span class="s1">&#39;box_height&#39;</span><span class="o">]</span>
28
28
  <span class="k">end</span>
29
29
 
30
30
 
31
- <span class="n">allParams</span><span class="o">.</span><span class="n">each</span> <span class="k">do</span> <span class="o">|</span><span class="n">param</span><span class="o">|</span>
32
- <span class="k">raise</span> <span class="s2">&quot;Please enter all required parameters&quot;</span> <span class="k">if</span> <span class="n">params</span><span class="o">[</span><span class="n">param</span><span class="o">].</span><span class="n">empty?</span>
31
+ <span class="n">all_params</span><span class="o">.</span><span class="n">each</span> <span class="k">do</span> <span class="o">|</span><span class="n">param</span><span class="o">|</span>
32
+ <span class="k">raise</span> <span class="s1">&#39;Please enter all required parameters&#39;</span> <span class="k">if</span> <span class="n">params</span><span class="o">[</span><span class="n">param</span><span class="o">].</span><span class="n">empty?</span>
33
33
  <span class="k">end</span>
34
34
 
35
35
 
36
- <span class="n">files_list</span> <span class="o">=</span> <span class="ss">GroupDocs</span><span class="p">:</span><span class="ss">:Storage</span><span class="o">::</span><span class="no">Folder</span><span class="o">.</span><span class="n">list!</span><span class="p">(</span><span class="s1">&#39;/&#39;</span><span class="p">,</span> <span class="p">{},</span> <span class="p">{</span> <span class="ss">:client_id</span> <span class="o">=&gt;</span> <span class="n">settings</span><span class="o">.</span><span class="n">client_id</span><span class="p">,</span> <span class="ss">:private_key</span> <span class="o">=&gt;</span> <span class="n">settings</span><span class="o">.</span><span class="n">private_key</span><span class="p">})</span>
36
+ <span class="n">files_list</span> <span class="o">=</span> <span class="ss">GroupDocs</span><span class="p">:</span><span class="ss">:Storage</span><span class="o">::</span><span class="no">Folder</span><span class="o">.</span><span class="n">list!</span><span class="p">(</span><span class="s1">&#39;/&#39;</span><span class="p">,</span> <span class="p">{},</span> <span class="p">{</span><span class="ss">:client_id</span> <span class="o">=&gt;</span> <span class="n">settings</span><span class="o">.</span><span class="n">client_id</span><span class="p">,</span> <span class="ss">:private_key</span> <span class="o">=&gt;</span> <span class="n">settings</span><span class="o">.</span><span class="n">private_key</span><span class="p">})</span>
37
37
  <span class="n">document</span> <span class="o">=</span> <span class="s1">&#39;&#39;</span>
38
38
 
39
39
 
@@ -51,28 +51,28 @@
51
51
 
52
52
 
53
53
  text annotation</p> </td> <td class="code"> <div class="highlight"><pre>
54
- <span class="k">if</span> <span class="n">settings</span><span class="o">.</span><span class="n">annotation_type</span> <span class="o">==</span> <span class="s2">&quot;text&quot;</span>
54
+ <span class="k">if</span> <span class="n">settings</span><span class="o">.</span><span class="n">annotation_type</span> <span class="o">==</span> <span class="s1">&#39;text&#39;</span>
55
55
  <span class="n">annotation</span><span class="o">.</span><span class="n">box</span> <span class="o">=</span> <span class="p">{</span><span class="ss">x</span><span class="p">:</span> <span class="n">params</span><span class="o">[</span><span class="s1">&#39;box_x&#39;</span><span class="o">]</span><span class="p">,</span> <span class="ss">y</span><span class="p">:</span> <span class="n">params</span><span class="o">[</span><span class="s1">&#39;box_y&#39;</span><span class="o">]</span><span class="p">,</span> <span class="ss">width</span><span class="p">:</span> <span class="n">params</span><span class="o">[</span><span class="s1">&#39;box_width&#39;</span><span class="o">]</span><span class="p">,</span> <span class="ss">height</span><span class="p">:</span> <span class="n">params</span><span class="o">[</span><span class="s1">&#39;box_height&#39;</span><span class="o">]</span><span class="p">}</span>
56
56
  <span class="n">annotation</span><span class="o">.</span><span class="n">annotationPosition</span> <span class="o">=</span> <span class="p">{</span><span class="ss">x</span><span class="p">:</span> <span class="n">params</span><span class="o">[</span><span class="s1">&#39;annotationPosition_x&#39;</span><span class="o">]</span><span class="p">,</span> <span class="ss">y</span><span class="p">:</span> <span class="n">params</span><span class="o">[</span><span class="s1">&#39;annotationPosition_y&#39;</span><span class="o">]</span><span class="p">}</span>
57
57
 
58
58
 
59
- <span class="k">elsif</span> <span class="n">settings</span><span class="o">.</span><span class="n">annotation_type</span> <span class="o">==</span> <span class="s2">&quot;area&quot;</span>
59
+ <span class="k">elsif</span> <span class="n">settings</span><span class="o">.</span><span class="n">annotation_type</span> <span class="o">==</span> <span class="s1">&#39;area&#39;</span>
60
60
  <span class="n">annotation</span><span class="o">.</span><span class="n">box</span> <span class="o">=</span> <span class="p">{</span><span class="ss">x</span><span class="p">:</span> <span class="n">params</span><span class="o">[</span><span class="s1">&#39;box_x&#39;</span><span class="o">]</span><span class="p">,</span> <span class="ss">y</span><span class="p">:</span> <span class="n">params</span><span class="o">[</span><span class="s1">&#39;box_y&#39;</span><span class="o">]</span><span class="p">,</span> <span class="ss">width</span><span class="p">:</span> <span class="n">params</span><span class="o">[</span><span class="s1">&#39;box_width&#39;</span><span class="o">]</span><span class="p">,</span> <span class="ss">height</span><span class="p">:</span> <span class="n">params</span><span class="o">[</span><span class="s1">&#39;box_height&#39;</span><span class="o">]</span><span class="p">}</span>
61
61
  <span class="n">annotation</span><span class="o">.</span><span class="n">annotationPosition</span> <span class="o">=</span> <span class="p">{</span><span class="ss">x</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span> <span class="ss">y</span><span class="p">:</span> <span class="mi">0</span><span class="p">}</span>
62
62
 
63
63
 
64
- <span class="k">elsif</span> <span class="n">settings</span><span class="o">.</span><span class="n">annotation_type</span> <span class="o">==</span> <span class="s2">&quot;point&quot;</span>
64
+ <span class="k">elsif</span> <span class="n">settings</span><span class="o">.</span><span class="n">annotation_type</span> <span class="o">==</span> <span class="s1">&#39;point&#39;</span>
65
65
  <span class="n">annotation</span><span class="o">.</span><span class="n">box</span> <span class="o">=</span> <span class="p">{</span><span class="ss">x</span><span class="p">:</span> <span class="n">params</span><span class="o">[</span><span class="s1">&#39;box_x&#39;</span><span class="o">]</span><span class="p">,</span> <span class="ss">y</span><span class="p">:</span> <span class="n">params</span><span class="o">[</span><span class="s1">&#39;box_y&#39;</span><span class="o">]</span><span class="p">,</span> <span class="ss">width</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span> <span class="ss">height</span><span class="p">:</span> <span class="mi">0</span><span class="p">}</span>
66
66
  <span class="n">annotation</span><span class="o">.</span><span class="n">annotationPosition</span> <span class="o">=</span> <span class="p">{</span><span class="ss">x</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span> <span class="ss">y</span><span class="p">:</span> <span class="mi">0</span><span class="p">}</span>
67
67
  <span class="k">end</span>
68
68
 
69
69
 
70
- <span class="n">annotation</span><span class="o">.</span><span class="n">create!</span><span class="p">({</span> <span class="ss">:client_id</span> <span class="o">=&gt;</span> <span class="n">settings</span><span class="o">.</span><span class="n">client_id</span><span class="p">,</span> <span class="ss">:private_key</span> <span class="o">=&gt;</span> <span class="n">settings</span><span class="o">.</span><span class="n">private_key</span><span class="p">})</span>
70
+ <span class="n">annotation</span><span class="o">.</span><span class="n">create!</span><span class="p">({</span><span class="ss">:client_id</span> <span class="o">=&gt;</span> <span class="n">settings</span><span class="o">.</span><span class="n">client_id</span><span class="p">,</span> <span class="ss">:private_key</span> <span class="o">=&gt;</span> <span class="n">settings</span><span class="o">.</span><span class="n">private_key</span><span class="p">})</span>
71
71
 
72
72
 
73
73
  <span class="n">reply</span> <span class="o">=</span> <span class="ss">GroupDocs</span><span class="p">:</span><span class="ss">:Document</span><span class="o">::</span><span class="ss">Annotation</span><span class="p">:</span><span class="ss">:Reply</span><span class="o">.</span><span class="n">new</span><span class="p">(</span><span class="ss">annotation</span><span class="p">:</span> <span class="n">annotation</span><span class="p">)</span>
74
74
  <span class="n">reply</span><span class="o">.</span><span class="n">text</span> <span class="o">=</span> <span class="n">params</span><span class="o">[</span><span class="s1">&#39;text&#39;</span><span class="o">]</span>
75
- <span class="n">reply</span><span class="o">.</span><span class="n">create!</span><span class="p">({</span> <span class="ss">:client_id</span> <span class="o">=&gt;</span> <span class="n">settings</span><span class="o">.</span><span class="n">client_id</span><span class="p">,</span> <span class="ss">:private_key</span> <span class="o">=&gt;</span> <span class="n">settings</span><span class="o">.</span><span class="n">private_key</span><span class="p">})</span>
75
+ <span class="n">reply</span><span class="o">.</span><span class="n">create!</span><span class="p">({</span><span class="ss">:client_id</span> <span class="o">=&gt;</span> <span class="n">settings</span><span class="o">.</span><span class="n">client_id</span><span class="p">,</span> <span class="ss">:private_key</span> <span class="o">=&gt;</span> <span class="n">settings</span><span class="o">.</span><span class="n">private_key</span><span class="p">})</span>
76
76
 
77
77
  <span class="k">end</span>
78
78
 
@@ -81,7 +81,7 @@ text annotation</p> </td> <td class="code">
81
81
  <span class="k">end</span>
82
82
 
83
83
 
84
- <span class="n">haml</span> <span class="ss">:sample11</span><span class="p">,</span> <span class="ss">:locals</span> <span class="o">=&gt;</span> <span class="p">{</span> <span class="ss">:userId</span> <span class="o">=&gt;</span> <span class="n">settings</span><span class="o">.</span><span class="n">client_id</span><span class="p">,</span> <span class="ss">:privateKey</span> <span class="o">=&gt;</span> <span class="n">settings</span><span class="o">.</span><span class="n">private_key</span><span class="p">,</span> <span class="ss">:fileId</span> <span class="o">=&gt;</span> <span class="n">settings</span><span class="o">.</span><span class="n">file_id</span><span class="p">,</span> <span class="ss">:annotationType</span> <span class="o">=&gt;</span> <span class="n">settings</span><span class="o">.</span><span class="n">annotation_type</span><span class="p">,</span> <span class="ss">:annotationId</span> <span class="o">=&gt;</span> <span class="p">(</span><span class="n">defined?</span> <span class="n">annotation</span><span class="o">.</span><span class="n">id</span><span class="p">)</span> <span class="p">?</span> <span class="n">annotation</span><span class="o">.</span><span class="n">id</span> <span class="p">:</span> <span class="kp">nil</span><span class="p">,</span> <span class="ss">:annotationText</span> <span class="o">=&gt;</span> <span class="n">params</span><span class="o">[</span><span class="s1">&#39;text&#39;</span><span class="o">]</span><span class="p">,</span> <span class="ss">:err</span> <span class="o">=&gt;</span> <span class="n">err</span> <span class="p">}</span>
84
+ <span class="n">haml</span> <span class="ss">:sample11</span><span class="p">,</span> <span class="ss">:locals</span> <span class="o">=&gt;</span> <span class="p">{</span><span class="ss">:userId</span> <span class="o">=&gt;</span> <span class="n">settings</span><span class="o">.</span><span class="n">client_id</span><span class="p">,</span> <span class="ss">:privateKey</span> <span class="o">=&gt;</span> <span class="n">settings</span><span class="o">.</span><span class="n">private_key</span><span class="p">,</span> <span class="ss">:fileId</span> <span class="o">=&gt;</span> <span class="n">settings</span><span class="o">.</span><span class="n">file_id</span><span class="p">,</span> <span class="ss">:annotationType</span> <span class="o">=&gt;</span> <span class="n">settings</span><span class="o">.</span><span class="n">annotation_type</span><span class="p">,</span> <span class="ss">:annotationId</span> <span class="o">=&gt;</span> <span class="p">(</span><span class="n">defined?</span> <span class="n">annotation</span><span class="o">.</span><span class="n">id</span><span class="p">)</span> <span class="p">?</span> <span class="n">annotation</span><span class="o">.</span><span class="n">id</span> <span class="p">:</span> <span class="kp">nil</span><span class="p">,</span> <span class="ss">:annotationText</span> <span class="o">=&gt;</span> <span class="n">params</span><span class="o">[</span><span class="s1">&#39;text&#39;</span><span class="o">]</span><span class="p">,</span> <span class="ss">:err</span> <span class="o">=&gt;</span> <span class="n">err</span><span class="p">}</span>
85
85
  <span class="k">end</span>
86
86
 
87
87
  </pre></div> </td> </tr> </tbody> </table> </div> </body> </html>
@@ -1,4 +1,4 @@
1
- <!DOCTYPE html> <html> <head> <title>sample12.rb</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <link rel="stylesheet" media="all" href="docco.css" /> </head> <body> <div id="container"> <div id="background"></div> <div id="jump_to"> Jump To &hellip; <div id="jump_wrapper"> <div id="jump_page"> <a class="source" href="envelope-sample.html"> envelope-sample.rb </a> <a class="source" href="sample1.html"> sample1.rb </a> <a class="source" href="sample10.html"> sample10.rb </a> <a class="source" href="sample11.html"> sample11.rb </a> <a class="source" href="sample12.html"> sample12.rb </a> <a class="source" href="sample13.html"> sample13.rb </a> <a class="source" href="sample14.html"> sample14.rb </a> <a class="source" href="sample15.html"> sample15.rb </a> <a class="source" href="sample16.html"> sample16.rb </a> <a class="source" href="sample17.html"> sample17.rb </a> <a class="source" href="sample18.html"> sample18.rb </a> <a class="source" href="sample2.html"> sample2.rb </a> <a class="source" href="sample3.html"> sample3.rb </a> <a class="source" href="sample4.html"> sample4.rb </a> <a class="source" href="sample5.html"> sample5.rb </a> <a class="source" href="sample6.html"> sample6.rb </a> <a class="source" href="sample7.html"> sample7.rb </a> <a class="source" href="sample8.html"> sample8.rb </a> <a class="source" href="sample9.html"> sample9.rb </a> </div> </div> </div> <table cellpadding="0" cellspacing="0"> <thead> <tr> <th class="docs"> <h1> sample12.rb </h1> </th> <th class="code"> </th> </tr> </thead> <tbody> <tr id="section-1"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-1">&#182;</a> </div> <p>GET request</p> </td> <td class="code"> <div class="highlight"><pre><span class="n">get</span> <span class="s1">&#39;/sample12&#39;</span> <span class="k">do</span>
1
+ <!DOCTYPE html> <html> <head> <title>sample12.rb</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <link rel="stylesheet" media="all" href="docco.css" /> </head> <body> <div id="container"> <div id="background"></div> <div id="jump_to"> Jump To &hellip; <div id="jump_wrapper"> <div id="jump_page"> <a class="source" href="annotation-sample.html"> annotation-sample.rb </a> <a class="source" href="envelope-sample.html"> envelope-sample.rb </a> <a class="source" href="sample1.html"> sample1.rb </a> <a class="source" href="sample10.html"> sample10.rb </a> <a class="source" href="sample11.html"> sample11.rb </a> <a class="source" href="sample12.html"> sample12.rb </a> <a class="source" href="sample13.html"> sample13.rb </a> <a class="source" href="sample14.html"> sample14.rb </a> <a class="source" href="sample15.html"> sample15.rb </a> <a class="source" href="sample16.html"> sample16.rb </a> <a class="source" href="sample17.html"> sample17.rb </a> <a class="source" href="sample18.html"> sample18.rb </a> <a class="source" href="sample19.html"> sample19.rb </a> <a class="source" href="sample2.html"> sample2.rb </a> <a class="source" href="sample20.html"> sample20.rb </a> <a class="source" href="sample21.html"> sample21.rb </a> <a class="source" href="sample22.html"> sample22.rb </a> <a class="source" href="sample3.html"> sample3.rb </a> <a class="source" href="sample4.html"> sample4.rb </a> <a class="source" href="sample5.html"> sample5.rb </a> <a class="source" href="sample6.html"> sample6.rb </a> <a class="source" href="sample7.html"> sample7.rb </a> <a class="source" href="sample8.html"> sample8.rb </a> <a class="source" href="sample9.html"> sample9.rb </a> </div> </div> </div> <table cellpadding="0" cellspacing="0"> <thead> <tr> <th class="docs"> <h1> sample12.rb </h1> </th> <th class="code"> </th> </tr> </thead> <tbody> <tr id="section-1"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-1">&#182;</a> </div> <p>GET request</p> </td> <td class="code"> <div class="highlight"><pre><span class="n">get</span> <span class="s1">&#39;/sample12&#39;</span> <span class="k">do</span>
2
2
  <span class="n">haml</span> <span class="ss">:sample12</span>
3
3
  <span class="k">end</span>
4
4
 
@@ -11,10 +11,10 @@
11
11
 
12
12
  <span class="k">begin</span>
13
13
 
14
- <span class="k">raise</span> <span class="s2">&quot;Please enter all required parameters&quot;</span> <span class="k">if</span> <span class="n">settings</span><span class="o">.</span><span class="n">client_id</span><span class="o">.</span><span class="n">empty?</span> <span class="ow">or</span> <span class="n">settings</span><span class="o">.</span><span class="n">private_key</span><span class="o">.</span><span class="n">empty?</span> <span class="ow">or</span> <span class="n">settings</span><span class="o">.</span><span class="n">file_id</span><span class="o">.</span><span class="n">empty?</span>
14
+ <span class="k">raise</span> <span class="s1">&#39;Please enter all required parameters&#39;</span> <span class="k">if</span> <span class="n">settings</span><span class="o">.</span><span class="n">client_id</span><span class="o">.</span><span class="n">empty?</span> <span class="ow">or</span> <span class="n">settings</span><span class="o">.</span><span class="n">private_key</span><span class="o">.</span><span class="n">empty?</span> <span class="ow">or</span> <span class="n">settings</span><span class="o">.</span><span class="n">file_id</span><span class="o">.</span><span class="n">empty?</span>
15
15
 
16
16
 
17
- <span class="n">files_list</span> <span class="o">=</span> <span class="ss">GroupDocs</span><span class="p">:</span><span class="ss">:Storage</span><span class="o">::</span><span class="no">Folder</span><span class="o">.</span><span class="n">list!</span><span class="p">(</span><span class="s1">&#39;/&#39;</span><span class="p">,</span> <span class="p">{},</span> <span class="p">{</span> <span class="ss">:client_id</span> <span class="o">=&gt;</span> <span class="n">settings</span><span class="o">.</span><span class="n">client_id</span><span class="p">,</span> <span class="ss">:private_key</span> <span class="o">=&gt;</span> <span class="n">settings</span><span class="o">.</span><span class="n">private_key</span><span class="p">})</span>
17
+ <span class="n">files_list</span> <span class="o">=</span> <span class="ss">GroupDocs</span><span class="p">:</span><span class="ss">:Storage</span><span class="o">::</span><span class="no">Folder</span><span class="o">.</span><span class="n">list!</span><span class="p">(</span><span class="s1">&#39;/&#39;</span><span class="p">,</span> <span class="p">{},</span> <span class="p">{</span><span class="ss">:client_id</span> <span class="o">=&gt;</span> <span class="n">settings</span><span class="o">.</span><span class="n">client_id</span><span class="p">,</span> <span class="ss">:private_key</span> <span class="o">=&gt;</span> <span class="n">settings</span><span class="o">.</span><span class="n">private_key</span><span class="p">})</span>
18
18
  <span class="n">document</span> <span class="o">=</span> <span class="s1">&#39;&#39;</span>
19
19
 
20
20
 
@@ -34,7 +34,7 @@
34
34
  <span class="k">end</span>
35
35
 
36
36
 
37
- <span class="n">haml</span> <span class="ss">:sample12</span><span class="p">,</span> <span class="ss">:locals</span> <span class="o">=&gt;</span> <span class="p">{</span> <span class="ss">:userId</span> <span class="o">=&gt;</span> <span class="n">settings</span><span class="o">.</span><span class="n">client_id</span><span class="p">,</span> <span class="ss">:privateKey</span> <span class="o">=&gt;</span> <span class="n">settings</span><span class="o">.</span><span class="n">private_key</span><span class="p">,</span> <span class="ss">:annotations</span> <span class="o">=&gt;</span> <span class="n">annotations</span><span class="p">,</span> <span class="ss">:fileId</span> <span class="o">=&gt;</span> <span class="n">settings</span><span class="o">.</span><span class="n">file_id</span><span class="p">,</span> <span class="ss">:err</span> <span class="o">=&gt;</span> <span class="n">err</span> <span class="p">}</span>
37
+ <span class="n">haml</span> <span class="ss">:sample12</span><span class="p">,</span> <span class="ss">:locals</span> <span class="o">=&gt;</span> <span class="p">{</span><span class="ss">:userId</span> <span class="o">=&gt;</span> <span class="n">settings</span><span class="o">.</span><span class="n">client_id</span><span class="p">,</span> <span class="ss">:privateKey</span> <span class="o">=&gt;</span> <span class="n">settings</span><span class="o">.</span><span class="n">private_key</span><span class="p">,</span> <span class="ss">:annotations</span> <span class="o">=&gt;</span> <span class="n">annotations</span><span class="p">,</span> <span class="ss">:fileId</span> <span class="o">=&gt;</span> <span class="n">settings</span><span class="o">.</span><span class="n">file_id</span><span class="p">,</span> <span class="ss">:err</span> <span class="o">=&gt;</span> <span class="n">err</span><span class="p">}</span>
38
38
  <span class="k">end</span>
39
39
 
40
40
  </pre></div> </td> </tr> </tbody> </table> </div> </body> </html>